LastPositionIndex
jdubs edited this page Oct 21, 2016
·
1 revision
Returns the result of a number comparison.
SpecName (multiple) The name of the variable for operation result assignment
Text (multiple) The variable containing the text to examine for the character
CharacterToFind (constant) The variable containing the character to find in the text
ErrorMessage (multiple | optional) The error message to return when any error occurs.
This method searches the variable for the last instance of the search character. For example, if you search for the letter "r" in "We are Four51" the returned value will be 11.
public static void LastPositionIndex(string SpecName, object Text, object CharacterToFind, object ErrorMessage)
{
Break();
try
{
Variable(SpecName).Value = Text.ToString().LastIndexOf((string)CharacterToFind).ToString();
}
catch (Exception ex)
{
throw new Four51ActionsException(ex.Message, (string)ErrorMessage);
}
}