String Members

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

NameDescription
Public MethodStringOverloaded. Initializes a new instance of the String class.

NameDescription
Public Field StaticEmpty Represents an empty instance of the String class. This field is read-only.

NameDescription
Public PropertyCharsGets the character at a specified index number (character position) in the current String object.
Public PropertyLengthGets the number of characters in the current String object.

NameDescription
Public Method StaticCompareCompares two specified String objects with one another.
Public MethodCompareToOverloaded. Compares the current String object with a specified String object or Object object.
Public Method StaticConcatOverloaded. Concatenates one or more String objects or the String representations of the args values for one or more Object objects.
Public Method StaticEqualsDetermines whether two specified String objects have the same value.
Public Method StaticEqualsOverloaded. The String type exposes the following methods.
Public MethodGetHashCode (Inherited from Object.)
Public MethodGetType (Inherited from Object.)
Public MethodIndexOfOverloaded. 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 MethodIndexOfAnyOverloaded. 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 StaticInternRetrieves the system's reference to a specified String object.
Public Method StaticIsInternedRetrieves a reference to a specified String object.
Public MethodLastIndexOfOverloaded. 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 MethodLastIndexOfAnyOverloaded. 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 Staticoperator !=Determines whether two specified String objects have different values.
Public Method Staticoperator ==Determines whether two specified String objects have the same value.
Public MethodReferenceEquals (Inherited from Object.)
Public MethodSplitOverloaded. 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 MethodSubstringOverloaded. Retrieves a substring from the current String object.
Public MethodToCharArrayOverloaded. Copies the characters in the current String object to an array of Unicode characters.
Public MethodToLowerReturns the current String object in lowercase.
Public MethodToStringReturns the current String object; no actual conversion is performed.
Public MethodToUpperReturns the current String object in uppercase.
Public MethodTrimOverloaded. Removes all occurrences of a specified array of Unicode characters from the beginning and end of the current String object.
Public MethodTrimEndRemoves all occurrences of a specified array of Unicode characters from the end of the current String object.
Public MethodTrimStartRemoves all occurrences of a specified array of Unicode characters from the beginning of the current String object.
Show: