Skip to content

TitleCase

jdubs edited this page Oct 21, 2016 · 1 revision

Table of Contents

Overview

Converts all words to Title Case.

Parameters

SpecName (constant) The variable containing the text to format.

ErrorMessage (multiple | optional) The error message to return when any error occurs.

Synopsis

This method simply converts the first letter of all words to upper case.

Source Code

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);
	}
}

Referenced Methods

Clone this wiki locally