-
Notifications
You must be signed in to change notification settings - Fork 1
TitleCase
jdubs edited this page Oct 21, 2016
·
1 revision
Converts all words to Title Case.
SpecName (constant) The variable containing the text to format.
ErrorMessage (multiple | optional) The error message to return when any error occurs.
This method simply converts the first letter of all words to upper case.
public static void TitleCase(string SpecName, object ErrorMessage) {
Break();
try {
var val = Variable(SpecName).Value;
CultureInfo info = Thread.CurrentThread.CurrentCulture;
TextInfo text = info.TextInfo;
Variable(SpecName).Value = text.ToTitleCase(val);
}
catch (Exception ex) {
throw new Four51ActionsException(ex.Message, (string)ErrorMessage);
}
}