C# Class LitDev.LDText

Datei anzeigen Open project: litdev1/LitDev

Public Methods

Method Description
Compare ( Primitive text1, Primitive text2 ) : Primitive

Lexically compare 2 text strings, the comparison is case insensitive and culture invariant.

FindAll ( Primitive text, Primitive find ) : Primitive

Get all occurances of a subtext in some text.

GetHeight ( Primitive text ) : Primitive

Get the height in pixels that text will be displayed in the GraphicsWindow with the current font. The GraphicsWindow must be open to use this method.

GetWidth ( Primitive text ) : Primitive

Get the width in pixels that text will be displayed in the GraphicsWindow with the current font. The GraphicsWindow must be open to use this method.

Replace ( Primitive text, Primitive find, Primitive replace ) : Primitive

Find and Replace all occurances of one text with another.

Split ( Primitive text, Primitive separator ) : Primitive

Split a variable into an array delimiated by a separator.

Trim ( Primitive text ) : Primitive

Return a string with all leading and trailing 'white space' removed.

Method Details

Compare() public static method

Lexically compare 2 text strings, the comparison is case insensitive and culture invariant.
public static Compare ( Primitive text1, Primitive text2 ) : Primitive
text1 Primitive The first string to compare.
text2 Primitive The second string to compare.
return Primitive

FindAll() public static method

Get all occurances of a subtext in some text.
public static FindAll ( Primitive text, Primitive find ) : Primitive
text Primitive The text to search.
find Primitive The subtext to search for.
return Primitive

GetHeight() public static method

Get the height in pixels that text will be displayed in the GraphicsWindow with the current font. The GraphicsWindow must be open to use this method.
public static GetHeight ( Primitive text ) : Primitive
text Primitive The text to get the height.
return Primitive

GetWidth() public static method

Get the width in pixels that text will be displayed in the GraphicsWindow with the current font. The GraphicsWindow must be open to use this method.
public static GetWidth ( Primitive text ) : Primitive
text Primitive The text to get the width.
return Primitive

Replace() public static method

Find and Replace all occurances of one text with another.
public static Replace ( Primitive text, Primitive find, Primitive replace ) : Primitive
text Primitive A text to modify.
find Primitive The text to find and replace.
replace Primitive The text to replace the found text.
return Primitive

Split() public static method

Split a variable into an array delimiated by a separator.
public static Split ( Primitive text, Primitive separator ) : Primitive
text Primitive A text string to split.
separator Primitive A separator string (e.g. " "), or an array of separator strings.
return Primitive

Trim() public static method

Return a string with all leading and trailing 'white space' removed.
public static Trim ( Primitive text ) : Primitive
text Primitive A string to trim.
return Primitive