-
Notifications
You must be signed in to change notification settings - Fork 1
SubString
jdubs edited this page Oct 21, 2016
·
1 revision
Returns the range of characters specified by the Start and Length from a variable value
SpecName (multiple) The name of the variable for operation result assignment
Start (multiple) The variable containing the number of total characters
Length (constant) The character to pad
ErrorMessage (multiple | optional) The error message to return when any error occurs.
Substring extracts the characters, in order, from the text starting at the Start index for the Length provided. For example, if you chose to get the SubString of "Four51 Document Actions" from starting position of 7 for a length of 8 the result will be "Document".
public static void SubString(string SpecName, object Start, object Length, object ErrorMessage)
{
Break();
try
{
var text = Variable(SpecName).Value;
var len = 0; var start = 0;
if (((string)Length).Length > 0) N(Start);
if (((string)Length).Length > 0) N(Length);
Variable(SpecName).Value = text.Substring(start, len);
}
catch (Exception ex)
{
throw new Four51ActionsException(ex.Message, (string)ErrorMessage);
}
}