-
Notifications
You must be signed in to change notification settings - Fork 1
Underline
jdubs edited this page Oct 21, 2016
·
1 revision
Applies underline attribute to specified text.
SpecName (constant) The variable containing the text to format. Variable must be Formatted Text type.
Character (multiple) The character(s) to find and underline.
ErrorMessage (multiple | optional) The error message to return when any error occurs.
Applicable for applying underline attributes to specific subsets of text within variables. For example, you may specify "cow" is underlined in the action. If the user enters "the cow jumped over the moon" the action would apply the underline attribute only to "cow" in the text.
public static void Underline(string SpecName, object Character, object ErrorMessage)
{
Break();
try
{
Variable(SpecName).Value = Variable(SpecName).Value.Replace((string)Character, String.Format("<_char underline='true'>{0}</_char>", (string)Character));
}
catch (Exception ex)
{
throw new Four51ActionsException(String.Format("{0}{1}", ex.Message, (string)ErrorMessage != String.Empty ? Environment.NewLine + (string)ErrorMessage : String.Empty));
}
}