Export (0) Print
Expand All
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

String Class

July 28, 2014

Represents text as a series of Unicode characters.

Namespace:  System
Assembly:  mscorlib (in mscorlib.dll)

'Declaration
Public NotInheritable Class String _
	Implements IEnumerable(Of Char), IEnumerable,  _
	IComparable, IComparable(Of String), IConvertible, IEquatable(Of String)

The String type exposes the following members.

  NameDescription
Public methodString(Char*)Security Critical. Initializes a new instance of the String class to the value indicated by a specified pointer to an array of Unicode characters.
Public methodString(Char())Initializes a new instance of the String class to the value indicated by an array of Unicode characters.
Public methodString(SByte*)Security Critical. Initializes a new instance of the String class to the value indicated by a pointer to an array of 8-bit signed integers.
Public methodString(Char, Int32)Initializes a new instance of the String class to the value indicated by a specified Unicode character repeated a specified number of times.
Public methodString(Char*, Int32, Int32)Security Critical. Initializes a new instance of the String class to the value indicated by a specified pointer to an array of Unicode characters, a starting character position within that array, and a length.
Public methodString(Char(), Int32, Int32)Initializes a new instance of the String class to the value indicated by an array of Unicode characters, a starting character position within that array, and a length.
Top

  NameDescription
Public propertyCharsGets the character at a specified character position in the current string.
Public propertyLengthGets the number of characters in the current string.
Top

  NameDescription
Public methodStatic memberCompare(String, String)Performs a culture-sensitive comparison of two specified String objects and returns an integer that indicates their relationship to one another in the sort order.
Public methodStatic memberCompare(String, String, StringComparison)Compares two specified String objects using the specified string comparison options and returns an integer that indicates their relationship to one another in the sort order.
Public methodStatic memberCompare(String, String, CultureInfo, CompareOptions)Compares two specified String objects using the specified comparison options and culture-specific information to influence the comparison, and returns an integer that indicates the relationship of the two strings to one another in the sort order.
Public methodStatic memberCompare(String, Int32, String, Int32, Int32)Performs a culture-sensitive comparison of substrings that are extracted from two specified String objects and returns an integer that indicates their relationship to one another in the sort order.
Public methodStatic memberCompare(String, Int32, String, Int32, Int32, StringComparison)Compares substrings of two specified String objects using the specified string comparison options and returns an integer that indicates their relationship to one another in the sort order.
Public methodStatic memberCompare(String, Int32, String, Int32, Int32, CultureInfo, CompareOptions)Compares substrings of two specified String objects using the specified comparison options and culture-specific information to influence the comparison, and returns an integer that indicates the relationship of the two substrings to one another in the sort order.
Public methodStatic memberCompareOrdinal(String, String)Compares two specified String objects by evaluating the numeric values of the corresponding Char objects in each string and returns an integer that indicates their relative position in the sort order.
Public methodStatic memberCompareOrdinal(String, Int32, String, Int32, Int32)Compares substrings of two specified String objects by evaluating the numeric values of the corresponding Char objects in each substring.
Public methodCompareTo(Object)Compares this instance with a specified Object and indicates whether this instance precedes, follows, or appears in the same position in the sort order as the specified Object.
Public methodCompareTo(String)Compares this instance with a specified String object and indicates whether this instance precedes, follows, or appears in the same position in the sort order as the specified String.
Public methodStatic memberConcat(Object)Creates the String representation of a specified object.
Public methodStatic memberConcat(Object())Concatenates the string representations of the elements in a specified Object array.
Public methodStatic memberConcat(IEnumerable(Of String))Concatenates the members of a constructed IEnumerable(Of T) collection of type String.
Public methodStatic memberConcat(String())Concatenates the elements of a specified String array.
Public methodStatic memberConcat(Object, Object)Concatenates the string representations of two specified objects.
Public methodStatic memberConcat(String, String)Concatenates two specified instances of String.
Public methodStatic memberConcat(Object, Object, Object)Concatenates the String representations of three specified objects.
Public methodStatic memberConcat(String, String, String)Concatenates three specified instances of String.
Public methodStatic memberConcat(String, String, String, String)Concatenates four specified instances of String.
Public methodStatic memberConcat(Of T)(IEnumerable(Of T))Concatenates the members of an IEnumerable(Of T) implementation.
Public methodContainsReturns a value indicating whether the specified String object occurs within this string.
Public methodStatic memberCopyCreates a new instance of String with the same value as a specified String.
Public methodCopyToCopies a specified number of characters from a specified position in this instance to a specified position in an array of Unicode characters.
Public methodEndsWith(String)Determines whether the end of this instance matches the specified string.
Public methodEndsWith(String, StringComparison)Determines whether the end of this string matches the specified string when compared using the specified comparison option.
Public methodEquals(Object)Determines whether this instance of String and a specified object, which must also be a String object, have the same value. (Overrides Object.Equals(Object).)
Public methodEquals(String)Determines whether this instance and another specified String object have the same value.
Public methodStatic memberEquals(String, String)Determines whether two specified String objects have the same value.
Public methodEquals(String, StringComparison)Determines whether this string and a specified String object have the same value. A parameter specifies the culture, case, and sort rules used in the comparison.
Public methodStatic memberEquals(String, String, StringComparison)Determines whether two specified String objects have the same value. A parameter specifies the culture, case, and sort rules used in the comparison.
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.)
Public methodStatic memberFormat(String, Object)Replaces one or more format items in a specified string with the string representation of a specified object.
Public methodStatic memberFormat(String, Object())Replaces the format item in a specified string with the string representation of a corresponding object in a specified array.
Public methodStatic memberFormat(IFormatProvider, String, Object())Replaces the format item in a specified string with the text equivalent of the value of a corresponding object in a specified array. A specified parameter supplies culture-specific formatting information.
Public methodStatic memberFormat(String, Object, Object)Replaces the format item in a specified string with the string representations of two specified objects.
Public methodStatic memberFormat(String, Object, Object, Object)Replaces the format items in a specified string with the string representation of three specified objects.
Public methodGetHashCodeReturns the hash code for this string. (Overrides Object.GetHashCode.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodGetTypeCodeReturns the TypeCode for class String.
Public methodIndexOf(Char)Reports the zero-based index of the first occurrence of the specified Unicode character in this string.
Public methodIndexOf(String)Reports the zero-based index of the first occurrence of the specified string in this instance.
Public methodIndexOf(Char, Int32)Reports the zero-based index of the first occurrence of the specified Unicode character in this string. The search starts at a specified character position.
Public methodIndexOf(String, Int32)Reports the zero-based index of the first occurrence of the specified string in this instance. The search starts at a specified character position.
Public methodIndexOf(String, StringComparison)Reports the zero-based index of the first occurrence of the specified string in the current String object. A parameter specifies the type of search to use for the specified string.
Public methodIndexOf(Char, Int32, Int32)Reports the zero-based index of the first occurrence of the specified character in this instance. The search starts at a specified character position and examines a specified number of character positions.
Public methodIndexOf(String, Int32, Int32)Reports the zero-based index of the first occurrence of the specified string this instance. The search starts at a specified character position and examines a specified number of character positions.
Public methodIndexOf(String, Int32, StringComparison)Reports the zero-based index of the first occurrence of the specified string in the current String object. Parameters specify the starting search position in the current string and the type of search to use for the specified string.
Public methodIndexOf(String, Int32, Int32, StringComparison)Reports the zero-based index of the first occurrence of the specified string in the current String object. Parameters specify the starting search position in the current string, the number of characters in the current string to search, and the type of search to use for the specified string.
Public methodIndexOfAny(Char())Reports the zero-based index of the first occurrence in this instance of any character in a specified array of Unicode characters.
Public methodIndexOfAny(Char(), Int32)Reports the zero-based index of the first occurrence in this instance of any character in a specified array of Unicode characters. The search starts at a specified character position.
Public methodIndexOfAny(Char(), Int32, Int32)Reports the zero-based index of the first occurrence in this instance of any character in a specified array of Unicode characters. The search starts at a specified character position and examines a specified number of character positions.
Public methodInsertReturns a new string in which a specified string is inserted at a specified index position in this instance.
Public methodStatic memberInternRetrieves the system's reference to the specified String.
Public methodStatic memberIsInternedRetrieves a reference to a specified String.
Public methodStatic memberIsNullOrEmptyIndicates whether the specified string is Nothing or an Empty string.
Public methodStatic memberIsNullOrWhiteSpaceIndicates whether a specified string is Nothing, empty, or consists only of white-space characters.
Public methodStatic memberJoin(String, IEnumerable(Of String))Concatenates the members of a constructed IEnumerable(Of T) collection of type String, using the specified separator between each member.
Public methodStatic memberJoin(String, Object())Concatenates the elements of an object array, using the specified separator between each element.
Public methodStatic memberJoin(String, String())Concatenates a specified separator String between each element of a specified String array, yielding a single concatenated string.
Public methodStatic memberJoin(String, String(), Int32, Int32)Concatenates a specified separator String between each element of a specified String array, yielding a single concatenated string. Parameters specify the first array element and number of elements to use.
Public methodStatic memberJoin(Of T)(String, IEnumerable(Of T))Concatenates the members of a string collection, using the specified separator between each member.
Public methodLastIndexOf(Char)Reports the zero-based index position of the last occurrence of a specified Unicode character within this instance.
Public methodLastIndexOf(String)Reports the zero-based index position of the last occurrence of a specified string within this instance.
Public methodLastIndexOf(Char, Int32)Reports the zero-based index position of the last occurrence of a specified Unicode character within this instance. The search starts at a specified character position and proceeds backward, toward the beginning of the string.
Public methodLastIndexOf(String, Int32)Reports the zero-based index position of the last occurrence of a specified string within this instance. The search starts at a specified character position and proceeds backward toward the beginning of the string.
Public methodLastIndexOf(String, StringComparison)Reports the zero-based index of the last occurrence of a specified string within the current String object. A parameter specifies the type of search to use for the specified string.
Public methodLastIndexOf(Char, Int32, Int32)Reports the zero-based index position of the last occurrence of the specified Unicode character in a substring within this instance. The search starts at a specified character position and proceeds backward toward the beginning of the string for a specified number of character positions.
Public methodLastIndexOf(String, Int32, Int32)Reports the zero-based index position of the last occurrence of a specified string within this instance. The search starts at a specified character position and proceeds backward toward the beginning of the string for a specified number of character positions.
Public methodLastIndexOf(String, Int32, StringComparison)Reports the zero-based index of the last occurrence of a specified string within the current string. The search starts at a specified character position and proceeds backward toward the beginning of the string. A parameter specifies the type of comparison to perform when searching for the specified string.
Public methodLastIndexOf(String, Int32, Int32, StringComparison)Reports the zero-based index position of the last occurrence of a specified string within this instance. The search starts at a specified character position and proceeds backward toward the beginning of the string for the specified number of character positions. A parameter specifies the type of comparison to perform when searching for the specified string.
Public methodLastIndexOfAny(Char())Reports the zero-based index position of the last occurrence in this instance of one or more characters specified in a Unicode array.
Public methodLastIndexOfAny(Char(), Int32)Reports the zero-based index position of the last occurrence in this instance of one or more characters specified in a Unicode array. The search starts at a specified character position and proceeds backward toward the beginning of the string.
Public methodLastIndexOfAny(Char(), Int32, Int32)Reports the zero-based index position of the last occurrence in this instance of one or more Unicode characters specified in an array. The search starts at a specified character position and proceeds backward toward the beginning of the string for a specified number of character positions.
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodPadLeft(Int32)Right-aligns the characters in this instance, padding with spaces on the left for a specified total length.
Public methodPadLeft(Int32, Char)Right-aligns the characters in this instance, padding on the left with a specified Unicode character for a specified total length.
Public methodPadRight(Int32)Returns a new string of a specified length in which the end of the string is padded with spaces or a specified Unicode character.
Public methodPadRight(Int32, Char)Left-aligns the characters in this string, padding on the right with a specified Unicode character, for a specified total length.
Public methodRemove(Int32)Deletes all the characters from this string beginning at a specified position and continuing through the last position.
Public methodRemove(Int32, Int32)Deletes a specified number of characters from this instance beginning at a specified position.
Public methodReplace(Char, Char)Returns a new string in which all occurrences of a specified Unicode character in the current string are replaced with another specified Unicode character.
Public methodReplace(String, String)Returns a new string in which all occurrences of a specified string in the current string are replaced with another specified string.
Public methodSplit(Char())Returns a string array that contains the substrings in this instance that are delimited by elements of a specified Unicode character array.
Public methodSplit(Char(), Int32)Returns a string array that contains the substrings in this instance that are delimited by elements of a specified Unicode character array. A parameter specifies the maximum number of substrings to return.
Public methodSplit(Char(), StringSplitOptions)Returns a string array that contains the substrings in this string that are delimited by elements of a specified Unicode character array. A parameter specifies whether to return empty array elements.
Public methodSplit(String(), StringSplitOptions)Returns a string array that contains the substrings in this string that are delimited by elements of a specified string array. A parameter specifies whether to return empty array elements.
Public methodSplit(Char(), Int32, StringSplitOptions)Returns a string array that contains the substrings in this string that are delimited by elements of a specified Unicode character array. Parameters specify the maximum number of substrings to return and whether to return empty array elements.
Public methodSplit(String(), Int32, StringSplitOptions)Returns a string array that contains the substrings in this string that are delimited by elements of a specified string array. Parameters specify the maximum number of substrings to return and whether to return empty array elements.
Public methodStartsWith(String)Determines whether the beginning of this instance matches the specified string.
Public methodStartsWith(String, StringComparison)Determines whether the beginning of this string instance matches the specified string when compared using the specified comparison option.
Public methodSubstring(Int32)Retrieves a substring from this instance. The substring starts at a specified character position.
Public methodSubstring(Int32, Int32)Retrieves a substring from this instance. The substring starts at a specified character position and has a specified length.
Public methodToCharArrayCopies the characters in this instance to a Unicode character array.
Public methodToCharArray(Int32, Int32)Copies the characters in a specified substring in this instance to a Unicode character array.
Public methodToLowerReturns a copy of this string converted to lowercase, using the casing rules of the current culture.
Public methodToLower(CultureInfo)Returns a copy of this string converted to lowercase, using the casing rules of the specified culture.
Public methodToLowerInvariantReturns a copy of this string converted to lowercase using the casing rules of the invariant culture.
Public methodToStringReturns this instance of the string; no actual conversion is performed. (Overrides Object.ToString.)
Public methodToString(IFormatProvider)Returns this instance of the string; no actual conversion is performed.
Public methodToUpperReturns a copy of this string converted to uppercase, using the casing rules of the current culture.
Public methodToUpper(CultureInfo)Returns a copy of this string converted to uppercase, using the casing rules of the specified culture.
Public methodToUpperInvariantReturns a copy of this string converted to uppercase using the casing rules of the invariant culture.
Public methodTrimRemoves all leading and trailing white-space characters from the current string.
Public methodTrim(Char())Removes all leading and trailing occurrences of a set of characters specified in an array from the current string.
Public methodTrimEndRemoves all trailing occurrences of a set of characters specified in an array from the current string.
Public methodTrimStartRemoves all leading occurrences of a set of characters specified in an array from the current string.
Top

  NameDescription
Public operatorStatic memberEqualityDetermines whether two specified String objects have the same value.
Public operatorStatic memberInequalityDetermines whether two specified String objects have different values.
Top

  NameDescription
Public Extension MethodAggregate(Of Char)(Func(Of Char, Char, Char))Overloaded. Applies an accumulator function over a sequence. (Defined by Enumerable.)
Public Extension MethodAggregate(Of Char, TAccumulate)(TAccumulate, Func(Of TAccumulate, Char, TAccumulate))Overloaded. Applies an accumulator function over a sequence. The specified seed value is used as the initial accumulator value. (Defined by Enumerable.)
Public Extension MethodAggregate(Of Char, TAccumulate, TResult)(TAccumulate, Func(Of TAccumulate, Char, TAccumulate), Func(Of TAccumulate, TResult))Overloaded. Applies an accumulator function over a sequence. The specified seed value is used as the initial accumulator value, and the specified function is used to select the result value. (Defined by Enumerable.)
Public Extension MethodAll(Of Char)Determines whether all elements of a sequence satisfy a condition. (Defined by Enumerable.)
Public Extension MethodAny(Of Char)Overloaded. Determines whether a sequence contains any elements. (Defined by Enumerable.)
Public Extension MethodAny(Of Char)(Func(Of Char, Boolean))Overloaded. Determines whether any element of a sequence satisfies a condition. (Defined by Enumerable.)
Public Extension MethodAsEnumerable(Of Char)Returns the input typed as IEnumerable(Of T). (Defined by Enumerable.)
Public Extension MethodAsQueryableOverloaded. Converts an IEnumerable to an IQueryable. (Defined by Queryable.)
Public Extension MethodAsQueryable(Of Char)Overloaded. Converts a generic IEnumerable(Of T) to a generic IQueryable(Of T). (Defined by Queryable.)
Public Extension MethodAverage(Of Char)(Func(Of Char, Decimal))Overloaded. Computes the average of a sequence of Decimal values that are obtained by invoking a transform function on each element of the input sequence. (Defined by Enumerable.)
Public Extension MethodAverage(Of Char)(Func(Of Char, Double))Overloaded. Computes the average of a sequence of Double values that are obtained by invoking a transform function on each element of the input sequence. (Defined by Enumerable.)
Public Extension MethodAverage(Of Char)(Func(Of Char, Int32))Overloaded. Computes the average of a sequence of Int32 values that are obtained by invoking a transform function on each element of the input sequence. (Defined by Enumerable.)
Public Extension MethodAverage(Of Char)(Func(Of Char, Int64))Overloaded. Computes the average of a sequence of Int64 values that are obtained by invoking a transform function on each element of the input sequence. (Defined by Enumerable.)
Public Extension MethodAverage(Of Char)(Func(Of Char, Nullable(Of Decimal)))Overloaded. Computes the average of a sequence of nullable Decimal values that are obtained by invoking a transform function on each element of the input sequence. (Defined by Enumerable.)
Public Extension MethodAverage(Of Char)(Func(Of Char, Nullable(Of Double)))Overloaded. Computes the average of a sequence of nullable Double values that are obtained by invoking a transform function on each element of the input sequence. (Defined by Enumerable.)
Public Extension MethodAverage(Of Char)(Func(Of Char, Nullable(Of Int32)))Overloaded. Computes the average of a sequence of nullable Int32 values that are obtained by invoking a transform function on each element of the input sequence. (Defined by Enumerable.)
Public Extension MethodAverage(Of Char)(Func(Of Char, Nullable(Of Int64)))Overloaded. Computes the average of a sequence of nullable Int64 values that are obtained by invoking a transform function on each element of the input sequence. (Defined by Enumerable.)
Public Extension MethodAverage(Of Char)(Func(Of Char, Nullable(Of Single)))Overloaded. Computes the average of a sequence of nullable Single values that are obtained by invoking a transform function on each element of the input sequence. (Defined by Enumerable.)
Public Extension MethodAverage(Of Char)(Func(Of Char, Single))Overloaded. Computes the average of a sequence of Single values that are obtained by invoking a transform function on each element of the input sequence. (Defined by Enumerable.)
Public Extension MethodCast(Of TResult)Converts the elements of an IEnumerable to the specified type. (Defined by Enumerable.)
Public Extension MethodConcat(Of Char)Concatenates two sequences. (Defined by Enumerable.)
Public Extension MethodContains(Of Char)(Char)Overloaded. Determines whether a sequence contains a specified element by using the default equality comparer. (Defined by Enumerable.)
Public Extension MethodContains(Of Char)(Char, IEqualityComparer(Of Char))Overloaded. Determines whether a sequence contains a specified element by using a specified IEqualityComparer(Of T). (Defined by Enumerable.)
Public Extension MethodCount(Of Char)Overloaded. Returns the number of elements in a sequence. (Defined by Enumerable.)
Public Extension MethodCount(Of Char)(Func(Of Char, Boolean))Overloaded. Returns a number that represents how many elements in the specified sequence satisfy a condition. (Defined by Enumerable.)
Public Extension MethodDefaultIfEmpty(Of Char)Overloaded. Returns the elements of the specified sequence or the type parameter's default value in a singleton collection if the sequence is empty. (Defined by Enumerable.)
Public Extension MethodDefaultIfEmpty(Of Char)(Char)Overloaded. Returns the elements of the specified sequence or the specified value in a singleton collection if the sequence is empty. (Defined by Enumerable.)
Public Extension MethodDistinct(Of Char)Overloaded. Returns distinct elements from a sequence by using the default equality comparer to compare values. (Defined by Enumerable.)
Public Extension MethodDistinct(Of Char)(IEqualityComparer(Of Char))Overloaded. Returns distinct elements from a sequence by using a specified IEqualityComparer(Of T) to compare values. (Defined by Enumerable.)
Public Extension MethodElementAt(Of Char)Returns the element at a specified index in a sequence. (Defined by Enumerable.)
Public Extension MethodElementAtOrDefault(Of Char)Returns the element at a specified index in a sequence or a default value if the index is out of range. (Defined by Enumerable.)
Public Extension MethodExcept(Of Char)(IEnumerable(Of Char))Overloaded. Produces the set difference of two sequences by using the default equality comparer to compare values. (Defined by Enumerable.)
Public Extension MethodExcept(Of Char)(IEnumerable(Of Char), IEqualityComparer(Of Char))Overloaded. Produces the set difference of two sequences by using the specified IEqualityComparer(Of T) to compare values. (Defined by Enumerable.)
Public Extension MethodFirst(Of Char)Overloaded. Returns the first element of a sequence. (Defined by Enumerable.)
Public Extension MethodFirst(Of Char)(Func(Of Char, Boolean))Overloaded. Returns the first element in a sequence that satisfies a specified condition. (Defined by Enumerable.)
Public Extension MethodFirstOrDefault(Of Char)Overloaded. Returns the first element of a sequence, or a default value if the sequence contains no elements. (Defined by Enumerable.)
Public Extension MethodFirstOrDefault(Of Char)(Func(Of Char, Boolean))Overloaded. Returns the first element of the sequence that satisfies a condition or a default value if no such element is found. (Defined by Enumerable.)
Public Extension MethodGroupBy(Of Char, TKey)(Func(Of Char, TKey))Overloaded. Groups the elements of a sequence according to a specified key selector function. (Defined by Enumerable.)
Public Extension MethodGroupBy(Of Char, TKey)(Func(Of Char, TKey), IEqualityComparer(Of TKey))Overloaded. Groups the elements of a sequence according to a specified key selector function and compares the keys by using a specified comparer. (Defined by Enumerable.)
Public Extension MethodGroupBy(Of Char, TKey, TElement)(Func(Of Char, TKey), Func(Of Char, TElement))Overloaded. Groups the elements of a sequence according to a specified key selector function and projects the elements for each group by using a specified function. (Defined by Enumerable.)
Public Extension MethodGroupBy(Of Char, TKey, TResult)(Func(Of Char, TKey), Func(Of TKey, IEnumerable(Of Char), TResult))Overloaded. Groups the elements of a sequence according to a specified key selector function and creates a result value from each group and its key. (Defined by Enumerable.)
Public Extension MethodGroupBy(Of Char, TKey, TElement)(Func(Of Char, TKey), Func(Of Char, TElement), IEqualityComparer(Of TKey))Overloaded. Groups the elements of a sequence according to a key selector function. The keys are compared by using a comparer and each group's elements are projected by using a specified function. (Defined by Enumerable.)
Public Extension MethodGroupBy(Of Char, TKey, TResult)(Func(Of Char, TKey), Func(Of TKey, IEnumerable(Of Char), TResult), IEqualityComparer(Of TKey))Overloaded. Groups the elements of a sequence according to a specified key selector function and creates a result value from each group and its key. The keys are compared by using a specified comparer. (Defined by Enumerable.)
Public Extension MethodGroupBy(Of Char, TKey, TElement, TResult)(Func(Of Char, TKey), Func(Of Char, TElement), Func(Of TKey, IEnumerable(Of TElement), TResult))Overloaded. Groups the elements of a sequence according to a specified key selector function and creates a result value from each group and its key. The elements of each group are projected by using a specified function. (Defined by Enumerable.)
Public Extension MethodGroupBy(Of Char, TKey, TElement, TResult)(Func(Of Char, TKey), Func(Of Char, TElement), Func(Of TKey, IEnumerable(Of TElement), TResult), IEqualityComparer(Of TKey))Overloaded. Groups the elements of a sequence according to a specified key selector function and creates a result value from each group and its key. Key values are compared by using a specified comparer, and the elements of each group are projected by using a specified function. (Defined by Enumerable.)
Public Extension MethodGroupJoin(Of Char, TInner, TKey, TResult)(IEnumerable(Of TInner), Func(Of Char, TKey), Func(Of TInner, TKey), Func(Of Char, IEnumerable(Of TInner), TResult))Overloaded. Correlates the elements of two sequences based on equality of keys and groups the results. The default equality comparer is used to compare keys. (Defined by Enumerable.)
Public Extension MethodGroupJoin(Of Char, TInner, TKey, TResult)(IEnumerable(Of TInner), Func(Of Char, TKey), Func(Of TInner, TKey), Func(Of Char, IEnumerable(Of TInner), TResult), IEqualityComparer(Of TKey))Overloaded. Correlates the elements of two sequences based on key equality and groups the results. A specified IEqualityComparer(Of T) is used to compare keys. (Defined by Enumerable.)
Public Extension MethodIntersect(Of Char)(IEnumerable(Of Char))Overloaded. Produces the set intersection of two sequences by using the default equality comparer to compare values. (Defined by Enumerable.)
Public Extension MethodIntersect(Of Char)(IEnumerable(Of Char), IEqualityComparer(Of Char))Overloaded. Produces the set intersection of two sequences by using the specified IEqualityComparer(Of T) to compare values. (Defined by Enumerable.)
Public Extension MethodJoin(Of Char, TInner, TKey, TResult)(IEnumerable(Of TInner), Func(Of Char, TKey), Func(Of TInner, TKey), Func(Of Char, TInner, TResult))Overloaded. Correlates the elements of two sequences based on matching keys. The default equality comparer is used to compare keys. (Defined by Enumerable.)
Public Extension MethodJoin(Of Char, TInner, TKey, TResult)(IEnumerable(Of TInner), Func(Of Char, TKey), Func(Of TInner, TKey), Func(Of Char, TInner, TResult), IEqualityComparer(Of TKey))Overloaded. Correlates the elements of two sequences based on matching keys. A specified IEqualityComparer(Of T) is used to compare keys. (Defined by Enumerable.)
Public Extension MethodLast(Of Char)Overloaded. Returns the last element of a sequence. (Defined by Enumerable.)
Public Extension MethodLast(Of Char)(Func(Of Char, Boolean))Overloaded. Returns the last element of a sequence that satisfies a specified condition. (Defined by Enumerable.)
Public Extension MethodLastOrDefault(Of Char)Overloaded. Returns the last element of a sequence, or a default value if the sequence contains no elements. (Defined by Enumerable.)
Public Extension MethodLastOrDefault(Of Char)(Func(Of Char, Boolean))Overloaded. Returns the last element of a sequence that satisfies a condition or a default value if no such element is found. (Defined by Enumerable.)
Public Extension MethodLongCount(Of Char)Overloaded. Returns an Int64 that represents the total number of elements in a sequence. (Defined by Enumerable.)
Public Extension MethodLongCount(Of Char)(Func(Of Char, Boolean))Overloaded. Returns an Int64 that represents how many elements in a sequence satisfy a condition. (Defined by Enumerable.)
Public Extension MethodMax(Of Char)Overloaded. Returns the maximum value in a generic sequence. (Defined by Enumerable.)
Public Extension MethodMax(Of Char)(Func(Of Char, Decimal))Overloaded. Invokes a transform function on each element of a sequence and returns the maximum Decimal value. (Defined by Enumerable.)
Public Extension MethodMax(Of Char)(Func(Of Char, Double))Overloaded. Invokes a transform function on each element of a sequence and returns the maximum Double value. (Defined by Enumerable.)
Public Extension MethodMax(Of Char)(Func(Of Char, Int32))Overloaded. Invokes a transform function on each element of a sequence and returns the maximum Int32 value. (Defined by Enumerable.)
Public Extension MethodMax(Of Char)(Func(Of Char, Int64))Overloaded. Invokes a transform function on each element of a sequence and returns the maximum Int64 value. (Defined by Enumerable.)
Public Extension MethodMax(Of Char)(Func(Of Char, Nullable(Of Decimal)))Overloaded. Invokes a transform function on each element of a sequence and returns the maximum nullable Decimal value. (Defined by Enumerable.)
Public Extension MethodMax(Of Char)(Func(Of Char, Nullable(Of Double)))Overloaded. Invokes a transform function on each element of a sequence and returns the maximum nullable Double value. (Defined by Enumerable.)
Public Extension MethodMax(Of Char)(Func(Of Char, Nullable(Of Int32)))Overloaded. Invokes a transform function on each element of a sequence and returns the maximum nullable Int32 value. (Defined by Enumerable.)
Public Extension MethodMax(Of Char)(Func(Of Char, Nullable(Of Int64)))Overloaded. Invokes a transform function on each element of a sequence and returns the maximum nullable Int64 value. (Defined by Enumerable.)
Public Extension MethodMax(Of Char)(Func(Of Char, Nullable(Of Single)))Overloaded. Invokes a transform function on each element of a sequence and returns the maximum nullable Single value. (Defined by Enumerable.)
Public Extension MethodMax(Of Char)(Func(Of Char, Single))Overloaded. Invokes a transform function on each element of a sequence and returns the maximum Single value. (Defined by Enumerable.)
Public Extension MethodMax(Of Char, TResult)(Func(Of Char, TResult))Overloaded. Invokes a transform function on each element of a generic sequence and returns the maximum resulting value. (Defined by Enumerable.)
Public Extension MethodMin(Of Char)Overloaded. Returns the minimum value in a generic sequence. (Defined by Enumerable.)
Public Extension MethodMin(Of Char)(Func(Of Char, Decimal))Overloaded. Invokes a transform function on each element of a sequence and returns the minimum Decimal value. (Defined by Enumerable.)
Public Extension MethodMin(Of Char)(Func(Of Char, Double))Overloaded. Invokes a transform function on each element of a sequence and returns the minimum Double value. (Defined by Enumerable.)
Public Extension MethodMin(Of Char)(Func(Of Char, Int32))Overloaded. Invokes a transform function on each element of a sequence and returns the minimum Int32 value. (Defined by Enumerable.)
Public Extension MethodMin(Of Char)(Func(Of Char, Int64))Overloaded. Invokes a transform function on each element of a sequence and returns the minimum Int64 value. (Defined by Enumerable.)
Public Extension MethodMin(Of Char)(Func(Of Char, Nullable(Of Decimal)))Overloaded. Invokes a transform function on each element of a sequence and returns the minimum nullable Decimal value. (Defined by Enumerable.)
Public Extension MethodMin(Of Char)(Func(Of Char, Nullable(Of Double)))Overloaded. Invokes a transform function on each element of a sequence and returns the minimum nullable Double value. (Defined by Enumerable.)
Public Extension MethodMin(Of Char)(Func(Of Char, Nullable(Of Int32)))Overloaded. Invokes a transform function on each element of a sequence and returns the minimum nullable Int32 value. (Defined by Enumerable.)
Public Extension MethodMin(Of Char)(Func(Of Char, Nullable(Of Int64)))Overloaded. Invokes a transform function on each element of a sequence and returns the minimum nullable Int64 value. (Defined by Enumerable.)
Public Extension MethodMin(Of Char)(Func(Of Char, Nullable(Of Single)))Overloaded. Invokes a transform function on each element of a sequence and returns the minimum nullable Single value. (Defined by Enumerable.)
Public Extension MethodMin(Of Char)(Func(Of Char, Single))Overloaded. Invokes a transform function on each element of a sequence and returns the minimum Single value. (Defined by Enumerable.)
Public Extension MethodMin(Of Char, TResult)(Func(Of Char, TResult))Overloaded. Invokes a transform function on each element of a generic sequence and returns the minimum resulting value. (Defined by Enumerable.)
Public Extension MethodOfType(Of TResult)Filters the elements of an IEnumerable based on a specified type. (Defined by Enumerable.)
Public Extension MethodOrderBy(Of Char, TKey)(Func(Of Char, TKey))Overloaded. Sorts the elements of a sequence in ascending order according to a key. (Defined by Enumerable.)
Public Extension MethodOrderBy(Of Char, TKey)(Func(Of Char, TKey), IComparer(Of TKey))Overloaded. Sorts the elements of a sequence in ascending order by using a specified comparer. (Defined by Enumerable.)
Public Extension MethodOrderByDescending(Of Char, TKey)(Func(Of Char, TKey))Overloaded. Sorts the elements of a sequence in descending order according to a key. (Defined by Enumerable.)
Public Extension MethodOrderByDescending(Of Char, TKey)(Func(Of Char, TKey), IComparer(Of TKey))Overloaded. Sorts the elements of a sequence in descending order by using a specified comparer. (Defined by Enumerable.)
Public Extension MethodReverse(Of Char)Inverts the order of the elements in a sequence. (Defined by Enumerable.)
Public Extension MethodSelect(Of Char, TResult)(Func(Of Char, TResult))Overloaded. Projects each element of a sequence into a new form. (Defined by Enumerable.)
Public Extension MethodSelect(Of Char, TResult)(Func(Of Char, Int32, TResult))Overloaded. Projects each element of a sequence into a new form by incorporating the element's index. (Defined by Enumerable.)
Public Extension MethodSelectMany(Of Char, TResult)(Func(Of Char, IEnumerable(Of TResult)))Overloaded. Projects each element of a sequence to an IEnumerable(Of T) and flattens the resulting sequences into one sequence. (Defined by Enumerable.)
Public Extension MethodSelectMany(Of Char, TResult)(Func(Of Char, Int32, IEnumerable(Of TResult)))Overloaded. Projects each element of a sequence to an IEnumerable(Of T), and flattens the resulting sequences into one sequence. The index of each source element is used in the projected form of that element. (Defined by Enumerable.)
Public Extension MethodSelectMany(Of Char, TCollection, TResult)(Func(Of Char, IEnumerable(Of TCollection)), Func(Of Char, TCollection, TResult))Overloaded. Projects each element of a sequence to an IEnumerable(Of T), flattens the resulting sequences into one sequence, and invokes a result selector function on each element therein. (Defined by Enumerable.)
Public Extension MethodSelectMany(Of Char, TCollection, TResult)(Func(Of Char, Int32, IEnumerable(Of TCollection)), Func(Of Char, TCollection, TResult))Overloaded. Projects each element of a sequence to an IEnumerable(Of T), flattens the resulting sequences into one sequence, and invokes a result selector function on each element therein. The index of each source element is used in the intermediate projected form of that element. (Defined by Enumerable.)
Public Extension MethodSequenceEqual(Of Char)(IEnumerable(Of Char))Overloaded. Determines whether two sequences are equal by comparing the elements by using the default equality comparer for their type. (Defined by Enumerable.)
Public Extension MethodSequenceEqual(Of Char)(IEnumerable(Of Char), IEqualityComparer(Of Char))Overloaded. Determines whether two sequences are equal by comparing their elements by using a specified IEqualityComparer(Of T). (Defined by Enumerable.)
Public Extension MethodSingle(Of Char)Overloaded. Returns the only element of a sequence, and throws an exception if there is not exactly one element in the sequence. (Defined by Enumerable.)
Public Extension MethodSingle(Of Char)(Func(Of Char, Boolean))Overloaded. Returns the only element of a sequence that satisfies a specified condition, and throws an exception if more than one such element exists. (Defined by Enumerable.)
Public Extension MethodSingleOrDefault(Of Char)Overloaded. Returns the only element of a sequence, or a default value if the sequence is empty; this method throws an exception if there is more than one element in the sequence. (Defined by Enumerable.)
Public Extension MethodSingleOrDefault(Of Char)(Func(Of Char, Boolean))Overloaded. Returns the only element of a sequence that satisfies a specified condition or a default value if no such element exists; this method throws an exception if more than one element satisfies the condition. (Defined by Enumerable.)
Public Extension MethodSkip(Of Char)Bypasses a specified number of elements in a sequence and then returns the remaining elements. (Defined by Enumerable.)
Public Extension MethodSkipWhile(Of Char)(Func(Of Char, Boolean))Overloaded. Bypasses elements in a sequence as long as a specified condition is true and then returns the remaining elements. (Defined by Enumerable.)
Public Extension MethodSkipWhile(Of Char)(Func(Of Char, Int32, Boolean))Overloaded. Bypasses elements in a sequence as long as a specified condition is true and then returns the remaining elements. The element's index is used in the logic of the predicate function. (Defined by Enumerable.)
Public Extension MethodSum(Of Char)(Func(Of Char, Decimal))Overloaded. Computes the sum of the sequence of Decimal values that are obtained by invoking a transform function on each element of the input sequence. (Defined by Enumerable.)
Public Extension MethodSum(Of Char)(Func(Of Char, Double))Overloaded. Computes the sum of the sequence of Double values that are obtained by invoking a transform function on each element of the input sequence. (Defined by Enumerable.)
Public Extension MethodSum(Of Char)(Func(Of Char, Int32))Overloaded. Computes the sum of the sequence of Int32 values that are obtained by invoking a transform function on each element of the input sequence. (Defined by Enumerable.)
Public Extension MethodSum(Of Char)(Func(Of Char, Int64))Overloaded. Computes the sum of the sequence of Int64 values that are obtained by invoking a transform function on each element of the input sequence. (Defined by Enumerable.)
Public Extension MethodSum(Of Char)(Func(Of Char, Nullable(Of Decimal)))Overloaded. Computes the sum of the sequence of nullable Decimal values that are obtained by invoking a transform function on each element of the input sequence. (Defined by Enumerable.)
Public Extension MethodSum(Of Char)(Func(Of Char, Nullable(Of Double)))Overloaded. Computes the sum of the sequence of nullable Double values that are obtained by invoking a transform function on each element of the input sequence. (Defined by Enumerable.)
Public Extension MethodSum(Of Char)(Func(Of Char, Nullable(Of Int32)))Overloaded. Computes the sum of the sequence of nullable Int32 values that are obtained by invoking a transform function on each element of the input sequence. (Defined by Enumerable.)
Public Extension MethodSum(Of Char)(Func(Of Char, Nullable(Of Int64)))Overloaded. Computes the sum of the sequence of nullable Int64 values that are obtained by invoking a transform function on each element of the input sequence. (Defined by Enumerable.)
Public Extension MethodSum(Of Char)(Func(Of Char, Nullable(Of Single)))Overloaded. Computes the sum of the sequence of nullable Single values that are obtained by invoking a transform function on each element of the input sequence. (Defined by Enumerable.)
Public Extension MethodSum(Of Char)(Func(Of Char, Single))Overloaded. Computes the sum of the sequence of Single values that are obtained by invoking a transform function on each element of the input sequence. (Defined by Enumerable.)
Public Extension MethodTake(Of Char)Returns a specified number of contiguous elements from the start of a sequence. (Defined by Enumerable.)
Public Extension MethodTakeWhile(Of Char)(Func(Of Char, Boolean))Overloaded. Returns elements from a sequence as long as a specified condition is true. (Defined by Enumerable.)
Public Extension MethodTakeWhile(Of Char)(Func(Of Char, Int32, Boolean))Overloaded. Returns elements from a sequence as long as a specified condition is true. The element's index is used in the logic of the predicate function. (Defined by Enumerable.)
Public Extension MethodToArray(Of Char)Creates an array from a IEnumerable(Of T). (Defined by Enumerable.)
Public Extension MethodToDictionary(Of Char, TKey)(Func(Of Char, TKey))Overloaded. Creates a Dictionary(Of TKey, TValue) from an IEnumerable(Of T) according to a specified key selector function. (Defined by Enumerable.)
Public Extension MethodToDictionary(Of Char, TKey)(Func(Of Char, TKey), IEqualityComparer(Of TKey))Overloaded. Creates a Dictionary(Of TKey, TValue) from an IEnumerable(Of T) according to a specified key selector function and key comparer. (Defined by Enumerable.)
Public Extension MethodToDictionary(Of Char, TKey, TElement)(Func(Of Char, TKey), Func(Of Char, TElement))Overloaded. Creates a Dictionary(Of TKey, TValue) from an IEnumerable(Of T) according to specified key selector and element selector functions. (Defined by Enumerable.)
Public Extension MethodToDictionary(Of Char, TKey, TElement)(Func(Of Char, TKey), Func(Of Char, TElement), IEqualityComparer(Of TKey))Overloaded. Creates a Dictionary(Of TKey, TValue) from an IEnumerable(Of T) according to a specified key selector function, a comparer, and an element selector function. (Defined by Enumerable.)
Public Extension MethodToList(Of Char)Creates a List(Of T) from an IEnumerable(Of T). (Defined by Enumerable.)
Public Extension MethodToLookup(Of Char, TKey)(Func(Of Char, TKey))Overloaded. Creates a Lookup(Of TKey, TElement) from an IEnumerable(Of T) according to a specified key selector function. (Defined by Enumerable.)
Public Extension MethodToLookup(Of Char, TKey)(Func(Of Char, TKey), IEqualityComparer(Of TKey))Overloaded. Creates a Lookup(Of TKey, TElement) from an IEnumerable(Of T) according to a specified key selector function and key comparer. (Defined by Enumerable.)
Public Extension MethodToLookup(Of Char, TKey, TElement)(Func(Of Char, TKey), Func(Of Char, TElement))Overloaded. Creates a Lookup(Of TKey, TElement) from an IEnumerable(Of T) according to specified key selector and element selector functions. (Defined by Enumerable.)
Public Extension MethodToLookup(Of Char, TKey, TElement)(Func(Of Char, TKey), Func(Of Char, TElement), IEqualityComparer(Of TKey))Overloaded. Creates a Lookup(Of TKey, TElement) from an IEnumerable(Of T) according to a specified key selector function, a comparer and an element selector function. (Defined by Enumerable.)
Public Extension MethodUnion(Of Char)(IEnumerable(Of Char))Overloaded. Produces the set union of two sequences by using the default equality comparer. (Defined by Enumerable.)
Public Extension MethodUnion(Of Char)(IEnumerable(Of Char), IEqualityComparer(Of Char))Overloaded. Produces the set union of two sequences by using a specified IEqualityComparer(Of T). (Defined by Enumerable.)
Public Extension MethodWhere(Of Char)(Func(Of Char, Boolean))Overloaded. Filters a sequence of values based on a predicate. (Defined by Enumerable.)
Public Extension MethodWhere(Of Char)(Func(Of Char, Int32, Boolean))Overloaded. Filters a sequence of values based on a predicate. Each element's index is used in the logic of the predicate function. (Defined by Enumerable.)
Public Extension MethodZip(Of Char, TSecond, TResult)Merges two sequences by using the specified predicate function. (Defined by Enumerable.)
Top

  NameDescription
Public fieldStatic memberEmptyRepresents the empty string. This field is read-only.
Top

  NameDescription
Explicit interface implemetationPrivate methodIConvertible.ToBooleanInfrastructure. For a description of this member, see ToBoolean.
Explicit interface implemetationPrivate methodIConvertible.ToByteInfrastructure. For a description of this member, see ToByte.
Explicit interface implemetationPrivate methodIConvertible.ToCharInfrastructure. For a description of this member, see ToChar.
Explicit interface implemetationPrivate methodIConvertible.ToDateTimeInfrastructure. For a description of this member, see ToDateTime.
Explicit interface implemetationPrivate methodIConvertible.ToDecimalInfrastructure. For a description of this member, see ToDecimal.
Explicit interface implemetationPrivate methodIConvertible.ToDoubleInfrastructure. For a description of this member, see ToDouble.
Explicit interface implemetationPrivate methodIConvertible.ToInt16Infrastructure. For a description of this member, see ToInt16.
Explicit interface implemetationPrivate methodIConvertible.ToInt32Infrastructure. For a description of this member, see ToInt32.
Explicit interface implemetationPrivate methodIConvertible.ToInt64Infrastructure. For a description of this member, see ToInt64.
Explicit interface implemetationPrivate methodIConvertible.ToSByteInfrastructure. For a description of this member, see ToSByte.
Explicit interface implemetationPrivate methodIConvertible.ToSingleInfrastructure. For a description of this member, see ToSingle.
Explicit interface implemetationPrivate methodIConvertible.ToTypeInfrastructure. For a description of this member, see ToType.
Explicit interface implemetationPrivate methodIConvertible.ToUInt16Infrastructure. For a description of this member, see ToUInt16.
Explicit interface implemetationPrivate methodIConvertible.ToUInt32Infrastructure. For a description of this member, see ToUInt32.
Explicit interface implemetationPrivate methodIConvertible.ToUInt64Infrastructure. For a description of this member, see ToUInt64.
Explicit interface implemetationPrivate methodIEnumerable(Of Char).GetEnumeratorReturns an enumerator that iterates through the current String object.
Explicit interface implemetationPrivate methodIEnumerable.GetEnumeratorReturns an enumerator that iterates through the current String object.
Top

A string is a sequential collection of Unicode characters that is used to represent text. A String object is a sequential collection of System.Char objects that represent a string. The value of the String object is the content of the sequential collection, and that value is immutable. The maximum size of a String object in memory is 2GB, or about 1 billion characters.

A String object is immutable (read-only) because its value cannot be modified once it has been created. Methods or operators (such as the concatenation operator) that appear to modify a String object actually create a new String object that contains the modification. In situations where you need to perform repeated modifications to a string, such as concatenating one or more characters to a string in a loop, the overhead and resulting performance hit associated with creating a new string object for each operation can be costly. In this case, the mutable System.Text.StringBuilder class can be used to modify a string without creating a new object for each string operation.

Each Unicode character in a string is defined by a Unicode scalar value, also called a Unicode code point or the ordinal (numeric) value of the Unicode character. Each code point is encoded using UTF-16 encoding, and the numeric value of each element of the encoding is represented by a Char object.

A single Char object usually represents a single code point; that is, the numeric value of the Char equals the code point. However, a code point might require more than one encoded element. For example, a Unicode supplementary code point (a surrogate pair) is encoded with two Char objects.

Indexes

An index is the position of a Char object, not a Unicode character, in a String. An index is a zero-based, nonnegative number starting from the first position in the string, which is index position zero. Consecutive index values might not correspond to consecutive Unicode characters because a Unicode character might be encoded as more than one Char object. To work with each Unicode character instead of each Char object, use the System.Globalization.StringInfo class.

Ordinal vs. Culture-Sensitive Operations

Members of the String class perform either an ordinal or linguistic operation on a String object. An ordinal operation acts on the numeric value of each Char object. A linguistic operation acts on the value of the String taking into account culture-specific casing, sorting, formatting, and parsing rules. Linguistic operations execute in the context of an explicitly declared culture or the implicit current culture. For more information about the current culture, see the CultureInfo.CurrentCulture topic.

Casing rules determine how to change a Unicode character between one case and another; for example, from lowercase to uppercase.

Formatting rules determine how to convert a value to its string representation, while parsing rules determine how to convert a string representation to a value.

Sort rules determine the alphabetic order of Unicode characters and how two strings compare to each other. For example, the Compare method performs a linguistic comparison while the CompareOrdinal method performs an ordinal comparison. Consequently, if the current culture is U.S. English, the Compare method considers 'a' less than 'A' while the CompareOrdinal method considers 'a' greater than 'A'.

The .NET Framework supports word, string, and ordinal sort rules. A word sort performs a culture-sensitive comparison of strings in which certain nonalphanumeric Unicode characters might have special weights assigned to them. For example, the hyphen ("-") might have a very small weight assigned to it so that "coop" and "co-op" appear next to each other in a sorted list. A string sort is similar to a word sort, except that there are no special cases and all nonalphanumeric symbols come before all alphanumeric Unicode characters.

A culture-sensitive comparison is any comparison that explicitly or implicitly uses a CultureInfo object, including the invariant culture that is specified by the CultureInfo.InvariantCulture property. The current implicit culture is specified by the Thread.CurrentCulture property.

An ordinal sort compares strings based on the numeric value of each Char object in the string. An ordinal comparison is automatically case-sensitive because the lowercase and uppercase versions of a character have different code points. However, if case is not important in your application, you can specify an ordinal comparison that ignores case. This is equivalent to converting the string to uppercase using the invariant culture and then performing an ordinal comparison on the result.

For more information about word, string, and ordinal sort rules, see the System.Globalization.CompareOptions topic.

A culture-sensitive comparison is typically appropriate for sorting, whereas an ordinal comparison is not. An ordinal comparison is typically appropriate for determining whether two strings are equal (that is, for determining identity), whereas a culture-sensitive comparison is not.

The Remarks for comparison and search methods specify whether the method is case-sensitive and/or culture-sensitive. By definition, any string, including the empty string (""), compares as greater than a null reference, and two null references compare as equal to each other.

Security Considerations

If your application makes a security decision about a symbolic identifier such as a file name or named pipe, or persisted data such as the text-based data in an XML file, the operation should use an ordinal comparison instead of a culture-sensitive comparison. This is because a culture-sensitive comparison can yield different results depending on the culture in effect, whereas an ordinal comparison depends solely on the binary value of the compared characters.

Functionality

The String class provides members to compare String objects, return the index of a character or string within a String object, copy the value of a String object, partition a string or combine strings, modify the value of string, format numbers, dates and times, or enumeration values into a string, and normalize a string.

Strings and Embedded Nulls

In the .NET Framework, a String object can include embedded nulls, which count as a part of the string's length. However, in some languages, such as C and C++, a null character indicates the end of a string, is not considered a part of the string, and is not counted as part of the string's length. This means that the following common assumptions that C and C++ programmers or that libraries written in C or C++ might make about strings are not necessarily valid when applied to String objects:

  • The value returned by the strlen or wcslen functions does not necessarily equal String.Length.

  • The string created by the strcpy_s or wcscpy_s functions is not necessarily identical to the string created by the String.Copy method.

You should ensure that native C and C++ code that instantiates String objects do not assume that an embedded null marks the end of the string.

Implemented Interfaces

The String class implements the IComparable, IConvertible, IComparable(Of T), IEnumerable, IEnumerable(Of T), and IEquatable(Of T) interfaces. Use the Convert class for conversions instead of this type's explicit interface member implementation of IConvertible.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

This type is thread safe.

Show:
© 2014 Microsoft