String Members

The following tables list the members exposed by the String type.

Public Constructors

Name Description
Public Method String Overloaded. Initializes a new instance of the String class.

Public Fields

Name Description
Public Field Static Empty Represents an empty instance of the String class. This field is read-only.

Public Properties

Name Description
Public Property Chars Gets the character at a specified index number (character position) in the current String object.
Public Property Length Gets the number of characters in the current String object.

Public Methods

Name Description
Public Method Static Compare Compares two specified String objects with one another.
Public Method CompareTo Overloaded. Compares the current String object with a specified String object or Object object.
Public Method Static Concat Overloaded. Concatenates one or more String objects or the String representations of the args values for one or more Object objects.
Public Method Static Equals Determines whether two specified String objects have the same value.
Public Method Equals Determines whether two specified String objects have the same value.
Public Method Equals (Inherited from Object.)
Public Method GetHashCode (Inherited from Object.)
Public Method GetType (Inherited from Object.)
Public Method IndexOf Overloaded. Reports the index number, or character position, of the first occurrence of a specified String object or one or more specified Unicode characters in the current String object.
Public Method IndexOfAny Overloaded. Reports the index number, or character position, of the first occurrence in the current String object of any character within a specified array of Unicode characters.
Public Method Static Intern Retrieves the system's reference to a specified String object.
Public Method Static IsInterned Retrieves a reference to a specified String object.
Public Method LastIndexOf Overloaded. Reports the index number, or character position, of the last occurrence of a specified Unicode character or String object in the current String object.
Public Method LastIndexOfAny Overloaded. Reports the index number, or character position, of the last occurrence in the current String object of any character within a specified array of Unicode characters.
Public Method Static operator != Determines whether two specified String objects have different values.
Public Method Static operator == Determines whether two specified String objects have the same value.
Public Method ReferenceEquals (Inherited from Object.)
Public Method Split Overloaded. Identifies the substrings in the current String object that are delimited by one or more characters specified in an array, and then places the substrings in a String array.
Public Method Substring Overloaded. Retrieves a substring from the current String object.
Public Method ToCharArray Overloaded. Copies the characters in the current String object to an array of Unicode characters.
Public Method ToLower Returns the current String object in lowercase.
Public Method ToString Returns the current String object; no actual conversion is performed.
Public Method ToUpper Returns the current String object in uppercase.
Public Method Trim Overloaded. Removes all occurrences of a specified array of Unicode characters from the beginning and end of the current String object.
Public Method TrimEnd Removes all occurrences of a specified array of Unicode characters from the end of the current String object.
Public Method TrimStart Removes all occurrences of a specified array of Unicode characters from the beginning of the current String object.

See Also

Reference

String Class
System Namespace