Italic
jdubs edited this page Oct 21, 2016
·
1 revision
Applies italic 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 italicize.
ErrorMessage (multiple | optional) The error message to return when any error occurs.
Applicable for applying italic attributes to specific subsets of text within variables. For example, you may specify "vs" is italicized in the Character parameter. If the user enters "Twins vs Royals" the method would apply the italic attribute only to "vs" in the text.
public static void Italic(string SpecName, object Character, object ErrorMessage)
{
Break();
try
{
Variable(SpecName).Value = Variable(SpecName).Value.Replace((string)Character, String.Format("<_char italic='true'>{0}</_char>", (string)Character));
}
catch (Exception ex)
{
throw new Four51ActionsException(ex.Message, (string)ErrorMessage);
}
}