Search Results

Saturday, April 11, 2009

Understanding the System.String Type and String Functions

System.String provides a number of methods you would expect from such a utility class, including methods that return the length of the character data, find sub-strings within the current string,convert to and from uppercase/lowercase, and so forth.

The String Type resides in the System namespace.All the string objects are mapped on the managed heap.

Below is some String Functions Listed...
//*****************************************************************************//
Length This property returns the length of the current string.

Compare() This method compares two strings.

Contains() This method determines whether a string contains a specific substring.

Equals() This method tests whether two string objects contain identical character data.

Format() This method formats a string using other primitives (e.g., numerical data, other
strings) and the {0} notation examined earlier in this chapter.
Insert() This method inserts a string within a given string.

PadLeft() This method is used to pad a string with some characters.

PadRight()This method is used to pad a string with some characters.

Remove() Use these methods to receive a copy of a string, with modifications (characters)

Replace() removed or replaced).

Split() This method returns a String array containing the substrings in this instance that are delimited by elements of a specified Char or String array.

Trim() This method removes all occurrences of a set of specified characters from the beginning and end of the current string.

ToUpper() These methods create a copy of the current string in uppercase or lowercase

ToLower() format, respectively.
//*****************************************************************************//

No comments:

Post a Comment