class string

in global :: System

Represents text as a sequence of UTF-16 code units.


public string( char* value )

Initializes a new instance of the class to the value indicated by a specified pointer to an array of Unicode characters.

  • value A pointer to a null-terminated array of Unicode characters.

public string( char* value, int startIndex, int length )

Initializes a new instance of the 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.

  • value A pointer to an array of Unicode characters.
  • startIndex The starting position within .
  • length The number of characters within to use.

public string( char c, int count )

Initializes a new instance of the class to the value indicated by a specified Unicode character repeated a specified number of times.

  • c A Unicode character.
  • count The number of times occurs.

public string( char[] value )

Initializes a new instance of the class to the value indicated by an array of Unicode characters.

  • value An array of Unicode characters.

public string( char[] value, int startIndex, int length )

Initializes a new instance of the class to the value indicated by an array of Unicode characters, a starting character position within that array, and a length.

  • value An array of Unicode characters.
  • startIndex The starting position within .
  • length The number of characters within to use.

public string( sbyte* value )

Initializes a new instance of the class to the value indicated by a pointer to an array of 8-bit signed integers.

  • value A pointer to a null-terminated array of 8-bit signed integers. The integers are interpreted using the current system code page encoding (that is, the encoding specified by ).

public string( sbyte* value, int startIndex, int length )

Initializes a new instance of the class to the value indicated by a specified pointer to an array of 8-bit signed integers, a starting position within that array, and a length.

  • value A pointer to an array of 8-bit signed integers. The integers are interpreted using the current system code page encoding (that is, the encoding specified by ).
  • startIndex The starting position within .
  • length The number of characters within to use.

public string( sbyte* value, int startIndex, int length, Encoding enc )

Initializes a new instance of the class to the value indicated by a specified pointer to an array of 8-bit signed integers, a starting position within that array, a length, and an object.

  • value A pointer to an array of 8-bit signed integers.
  • startIndex The starting position within .
  • length The number of characters within to use.
  • enc An object that specifies how the array referenced by is encoded. If is , ANSI encoding is assumed.

public static int Compare( string strA, int indexA, string strB, int indexB, int length )

Compares substrings of two specified objects and returns an integer that indicates their relative position in the sort order.

  • strA The first string to use in the comparison.
  • indexA The position of the substring within .
  • strB The second string to use in the comparison.
  • indexB The position of the substring within .
  • length The maximum number of characters in the substrings to compare.
  • Returns A 32-bit signed integer indicating the lexical relationship between the two comparands. Value Condition Less than zero The substring in precedes the substring in in the sort order. Zero The substrings occur in the same position in the sort order, or is zero. Greater than zero The substring in follows the substring in in the sort order.

public static int Compare( string strA, int indexA, string strB, int indexB, int length, bool ignoreCase )

Compares substrings of two specified objects, ignoring or honoring their case, and returns an integer that indicates their relative position in the sort order.

  • strA The first string to use in the comparison.
  • indexA The position of the substring within .
  • strB The second string to use in the comparison.
  • indexB The position of the substring within .
  • length The maximum number of characters in the substrings to compare.
  • ignoreCase to ignore case during the comparison; otherwise, .
  • Returns A 32-bit signed integer that indicates the lexical relationship between the two comparands. Value Condition Less than zero The substring in precedes the substring in in the sort order. Zero The substrings occur in the same position in the sort order, or is zero. Greater than zero The substring in follows the substring in in the sort order.

public static int Compare( string strA, int indexA, string strB, int indexB, int length, bool ignoreCase, CultureInfo culture )

Compares substrings of two specified objects, ignoring or honoring their case and using culture-specific information to influence the comparison, and returns an integer that indicates their relative position in the sort order.

  • strA The first string to use in the comparison.
  • indexA The position of the substring within .
  • strB The second string to use in the comparison.
  • indexB The position of the substring within .
  • length The maximum number of characters in the substrings to compare.
  • ignoreCase to ignore case during the comparison; otherwise, .
  • culture An object that supplies culture-specific comparison information.
  • Returns An integer that indicates the lexical relationship between the two comparands. Value Condition Less than zero The substring in precedes the substring in in the sort order. Zero The substrings occur in the same position in the sort order, or is zero. Greater than zero The substring in follows the substring in in the sort order.

public static int Compare( string strA, int indexA, string strB, int indexB, int length, CultureInfo culture, CompareOptions options )

Compares substrings of two specified 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 each other in the sort order.

  • strA The first string to use in the comparison.
  • indexA The starting position of the substring within .
  • strB The second string to use in the comparison.
  • indexB The starting position of the substring within .
  • length The maximum number of characters in the substrings to compare.
  • culture An object that supplies culture-specific comparison information.
  • options Options to use when performing the comparison (such as ignoring case or symbols).
  • Returns An integer that indicates the lexical relationship between the two substrings, as shown in the following table. Value Condition Less than zero The substring in precedes the substring in in the sort order. Zero The substrings occur in the same position in the sort order, or is zero. Greater than zero The substring in follows the substring in in the sort order.

public static int Compare( string strA, int indexA, string strB, int indexB, int length, StringComparison comparisonType )

Compares substrings of two specified objects using the specified rules, and returns an integer that indicates their relative position in the sort order.

  • strA The first string to use in the comparison.
  • indexA The position of the substring within .
  • strB The second string to use in the comparison.
  • indexB The position of the substring within .
  • length The maximum number of characters in the substrings to compare.
  • comparisonType One of the enumeration values that specifies the rules to use in the comparison.
  • Returns A 32-bit signed integer that indicates the lexical relationship between the two comparands. Value Condition Less than zero The substring in precedes the substring in in the sort order. Zero The substrings occur in the same position in the sort order, or the parameter is zero. Greater than zero The substring in follows the substring in in the sort order.

public static int Compare( string strA, string strB )

Compares two specified objects and returns an integer that indicates their relative position in the sort order.

  • strA The first string to compare.
  • strB The second string to compare.
  • Returns A 32-bit signed integer that indicates the lexical relationship between the two comparands. Value Condition Less than zero precedes in the sort order. Zero occurs in the same position as in the sort order. Greater than zero follows in the sort order.

public static int Compare( string strA, string strB, bool ignoreCase )

Compares two specified objects, ignoring or honoring their case, and returns an integer that indicates their relative position in the sort order.

  • strA The first string to compare.
  • strB The second string to compare.
  • ignoreCase to ignore case during the comparison; otherwise, .
  • Returns A 32-bit signed integer that indicates the lexical relationship between the two comparands. Value Condition Less than zero precedes in the sort order. Zero occurs in the same position as in the sort order. Greater than zero follows in the sort order.

public static int Compare( string strA, string strB, bool ignoreCase, CultureInfo culture )

Compares two specified objects, ignoring or honoring their case, and using culture-specific information to influence the comparison, and returns an integer that indicates their relative position in the sort order.

  • strA The first string to compare.
  • strB The second string to compare.
  • ignoreCase to ignore case during the comparison; otherwise, .
  • culture An object that supplies culture-specific comparison information.
  • Returns A 32-bit signed integer that indicates the lexical relationship between the two comparands. Value Condition Less than zero precedes in the sort order. Zero occurs in the same position as in the sort order. Greater than zero follows in the sort order.

public static int Compare( string strA, string strB, CultureInfo culture, CompareOptions options )

Compares two specified 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 each other in the sort order.

  • strA The first string to compare.
  • strB The second string to compare.
  • culture The culture that supplies culture-specific comparison information.
  • options Options to use when performing the comparison (such as ignoring case or symbols).
  • Returns A 32-bit signed integer that indicates the lexical relationship between and , as shown in the following table Value Condition Less than zero precedes in the sort order. Zero occurs in the same position as in the sort order. Greater than zero follows in the sort order.

public static int Compare( string strA, string strB, StringComparison comparisonType )

Compares two specified objects using the specified rules, and returns an integer that indicates their relative position in the sort order.

  • strA The first string to compare.
  • strB The second string to compare.
  • comparisonType One of the enumeration values that specifies the rules to use in the comparison.
  • Returns A 32-bit signed integer that indicates the lexical relationship between the two comparands. Value Condition Less than zero precedes in the sort order. Zero is in the same position as in the sort order. Greater than zero follows in the sort order.

public static int CompareOrdinal( string strA, int indexA, string strB, int indexB, int length )

Compares substrings of two specified objects by evaluating the numeric values of the corresponding objects in each substring.

  • strA The first string to use in the comparison.
  • indexA The starting index of the substring in .
  • strB The second string to use in the comparison.
  • indexB The starting index of the substring in .
  • length The maximum number of characters in the substrings to compare.
  • Returns A 32-bit signed integer that indicates the lexical relationship between the two comparands. Value Condition Less than zero The substring in is less than the substring in . Zero The substrings are equal, or is zero. Greater than zero The substring in is greater than the substring in .

public static int CompareOrdinal( string strA, string strB )

Compares two specified objects by evaluating the numeric values of the corresponding objects in each string.

  • strA The first string to compare.
  • strB The second string to compare.
  • Returns An integer that indicates the lexical relationship between the two comparands. Value Condition Less than zero is less than . Zero and are equal. Greater than zero is greater than .

public int CompareTo( object value )

Compares this instance with a specified and indicates whether this instance precedes, follows, or appears in the same position in the sort order as the specified .

  • value An object that evaluates to a .
  • Returns A 32-bit signed integer that indicates whether this instance precedes, follows, or appears in the same position in the sort order as the parameter. Value Condition Less than zero This instance precedes . Zero This instance has the same position in the sort order as . Greater than zero This instance follows . -or- is .

public int CompareTo( string strB )

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 string.

  • strB The string to compare with this instance.
  • Returns A 32-bit signed integer that indicates whether this instance precedes, follows, or appears in the same position in the sort order as the parameter. Value Condition Less than zero This instance precedes . Zero This instance has the same position in the sort order as . Greater than zero This instance follows . -or- is .

public static string Concat( object arg0 )

Creates the string representation of a specified object.

  • arg0 The object to represent, or .
  • Returns The string representation of the value of , or if is .

public static string Concat( object arg0, object arg1 )

Concatenates the string representations of two specified objects.

  • arg0 The first object to concatenate.
  • arg1 The second object to concatenate.
  • Returns The concatenated string representations of the values of and .

public static string Concat( object arg0, object arg1, object arg2 )

Concatenates the string representations of three specified objects.

  • arg0 The first object to concatenate.
  • arg1 The second object to concatenate.
  • arg2 The third object to concatenate.
  • Returns The concatenated string representations of the values of , , and .

public static string Concat( object[] args )

Concatenates the string representations of the elements in a specified array.

  • args An object array that contains the elements to concatenate.
  • Returns The concatenated string representations of the values of the elements in .

public static string Concat( string str0, string str1 )

Concatenates two specified instances of .

  • str0 The first string to concatenate.
  • str1 The second string to concatenate.
  • Returns The concatenation of and .

public static string Concat( string str0, string str1, string str2 )

Concatenates three specified instances of .

  • str0 The first string to concatenate.
  • str1 The second string to concatenate.
  • str2 The third string to concatenate.
  • Returns The concatenation of , , and .

public static string Concat( string str0, string str1, string str2, string str3 )

Concatenates four specified instances of .

  • str0 The first string to concatenate.
  • str1 The second string to concatenate.
  • str2 The third string to concatenate.
  • str3 The fourth string to concatenate.
  • Returns The concatenation of , , , and .

public static string Concat( string[] values )

Concatenates the elements of a specified array.

  • values An array of string instances.
  • Returns The concatenated elements of .

public bool Contains( char value )

Returns a value indicating whether a specified character occurs within this string.

  • value The character to seek.
  • Returns if the parameter occurs within this string; otherwise, .

public bool Contains( char value, StringComparison comparisonType )

Returns a value indicating whether a specified character occurs within this string, using the specified comparison rules.

  • value The character to seek.
  • comparisonType One of the enumeration values that specifies the rules to use in the comparison.
  • Returns if the parameter occurs within this string; otherwise, .

public bool Contains( string value )

Returns a value indicating whether a specified substring occurs within this string.

  • value The string to seek.
  • Returns if the parameter occurs within this string, or if is the empty string (""); otherwise, .

public bool Contains( string value, StringComparison comparisonType )

Returns a value indicating whether a specified string occurs within this string, using the specified comparison rules.

  • value The string to seek.
  • comparisonType One of the enumeration values that specifies the rules to use in the comparison.
  • Returns if the parameter occurs within this string, or if is the empty string (""); otherwise, .

public static string Copy( string str )

Creates a new instance of with the same value as a specified .

  • str The string to copy.
  • Returns A new string with the same value as .

public void CopyTo( int sourceIndex, char[] destination, int destinationIndex, int count )

Copies a specified number of characters from a specified position in this instance to a specified position in an array of Unicode characters.

  • sourceIndex The index of the first character in this instance to copy.
  • destination An array of Unicode characters to which characters in this instance are copied.
  • destinationIndex The index in at which the copy operation begins.
  • count The number of characters in this instance to copy to .

public static string Empty

Represents the empty string. This field is read-only.

public bool EndsWith( char value )

No summary.

public bool EndsWith( string value )

Determines whether the end of this string instance matches the specified string.

  • value The string to compare to the substring at the end of this instance.
  • Returns if matches the end of this instance; otherwise, .

public bool EndsWith( string value, bool ignoreCase, CultureInfo culture )

Determines whether the end of this string instance matches the specified string when compared using the specified culture.

  • value The string to compare to the substring at the end of this instance.
  • ignoreCase to ignore case during the comparison; otherwise, .
  • culture Cultural information that determines how this instance and are compared. If is , the current culture is used.
  • Returns if the parameter matches the end of this string; otherwise, .

public bool EndsWith( string value, StringComparison comparisonType )

Determines whether the end of this string instance matches the specified string when compared using the specified comparison option.

  • value The string to compare to the substring at the end of this instance.
  • comparisonType One of the enumeration values that determines how this string and are compared.
  • Returns if the parameter matches the end of this string; otherwise, .

public bool Equals( object obj )

Determines whether this instance and a specified object, which must also be a object, have the same value.

  • obj The string to compare to this instance.
  • Returns if is a and its value is the same as this instance; otherwise, . If is , the method returns .

public bool Equals( string value )

Determines whether this instance and another specified object have the same value.

  • value The string to compare to this instance.
  • Returns if the value of the parameter is the same as the value of this instance; otherwise, . If is , the method returns .

public static bool Equals( string a, string b )

Determines whether two specified objects have the same value.

  • a The first string to compare, or .
  • b The second string to compare, or .
  • Returns if the value of is the same as the value of ; otherwise, . If both and are , the method returns .

public static bool Equals( string a, string b, StringComparison comparisonType )

Determines whether two specified objects have the same value. A parameter specifies the culture, case, and sort rules used in the comparison.

  • a The first string to compare, or .
  • b The second string to compare, or .
  • comparisonType One of the enumeration values that specifies the rules for the comparison.
  • Returns if the value of the parameter is equal to the value of the parameter; otherwise, .

public bool Equals( string value, StringComparison comparisonType )

Determines whether this string and a specified object have the same value. A parameter specifies the culture, case, and sort rules used in the comparison.

  • value The string to compare to this instance.
  • comparisonType One of the enumeration values that specifies how the strings will be compared.
  • Returns if the value of the parameter is the same as this string; otherwise, .

public static string Format( IFormatProvider provider, string format, object arg0 )

Replaces the format item or items in a specified string with the string representation of the corresponding object. A parameter supplies culture-specific formatting information.

  • provider An object that supplies culture-specific formatting information.
  • format A composite format string.
  • arg0 The object to format.
  • Returns A copy of in which the format item or items have been replaced by the string representation of .

public static string Format( IFormatProvider provider, string format, object arg0, object arg1 )

Replaces the format items in a string with the string representation of two specified objects. A parameter supplies culture-specific formatting information.

  • provider An object that supplies culture-specific formatting information.
  • format A composite format string.
  • arg0 The first object to format.
  • arg1 The second object to format.
  • Returns A copy of in which format items are replaced by the string representations of and .

public static string Format( IFormatProvider provider, string format, object arg0, object arg1, object arg2 )

Replaces the format items in a string with the string representation of three specified objects. An parameter supplies culture-specific formatting information.

  • provider An object that supplies culture-specific formatting information.
  • format A composite format string.
  • arg0 The first object to format.
  • arg1 The second object to format.
  • arg2 The third object to format.
  • Returns A copy of in which the format items have been replaced by the string representations of , , and .

public static string Format( IFormatProvider provider, string format, object[] args )

Replaces the format items in a string with the string representations of corresponding objects in a specified array. A parameter supplies culture-specific formatting information.

  • provider An object that supplies culture-specific formatting information.
  • format A composite format string.
  • args An object array that contains zero or more objects to format.
  • Returns A copy of in which the format items have been replaced by the string representation of the corresponding objects in .

public static string Format( string format, object arg0 )

Replaces one or more format items in a string with the string representation of a specified object.

  • format A composite format string.
  • arg0 The object to format.
  • Returns A copy of in which any format items are replaced by the string representation of .

public static string Format( string format, object arg0, object arg1 )

Replaces the format items in a string with the string representation of two specified objects.

  • format A composite format string.
  • arg0 The first object to format.
  • arg1 The second object to format.
  • Returns A copy of in which format items are replaced by the string representations of and .

public static string Format( string format, object arg0, object arg1, object arg2 )

Replaces the format items in a string with the string representation of three specified objects.

  • format A composite format string.
  • arg0 The first object to format.
  • arg1 The second object to format.
  • arg2 The third object to format.
  • Returns A copy of in which the format items have been replaced by the string representations of , , and .

public static string Format( string format, object[] args )

Replaces the format item in a specified string with the string representation of a corresponding object in a specified array.

  • format A composite format string.
  • args An object array that contains zero or more objects to format.
  • Returns A copy of in which the format items have been replaced by the string representation of the corresponding objects in .

public int GetHashCode( StringComparison comparisonType )

Returns the hash code for this string using the specified rules.

  • comparisonType One of the enumeration values that specifies the rules to use in the comparison.
  • Returns A 32-bit signed integer hash code.

public int IndexOf( char value )

Reports the zero-based index of the first occurrence of the specified Unicode character in this string.

  • value A Unicode character to seek.
  • Returns The zero-based index position of if that character is found, or -1 if it is not.

public int IndexOf( char value, int startIndex )

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.

  • value A Unicode character to seek.
  • startIndex The search starting position.
  • Returns The zero-based index position of from the start of the string if that character is found, or -1 if it is not.

public int IndexOf( char value, int startIndex, int count )

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.

  • value A Unicode character to seek.
  • startIndex The search starting position.
  • count The number of character positions to examine.
  • Returns The zero-based index position of from the start of the string if that character is found, or -1 if it is not.

public int IndexOf( char value, StringComparison comparisonType )

Reports the zero-based index of the first occurrence of the specified Unicode character in this string. A parameter specifies the type of search to use for the specified character.

  • value The character to seek.
  • comparisonType An enumeration value that specifies the rules for the search.
  • Returns The zero-based index of if that character is found, or -1 if it is not.

public int IndexOf( string value )

Reports the zero-based index of the first occurrence of the specified string in this instance.

  • value The string to seek.
  • Returns The zero-based index position of if that string is found, or -1 if it is not. If is , the return value is 0.

public int IndexOf( string value, int startIndex )

Reports the zero-based index of the first occurrence of the specified string in this instance. The search starts at a specified character position.

  • value The string to seek.
  • startIndex The search starting position.
  • Returns The zero-based index position of from the start of the current instance if that string is found, or -1 if it is not. If is , the return value is .

public int IndexOf( string value, int startIndex, int count )

Reports the zero-based index of the first occurrence of the specified string in this instance. The search starts at a specified character position and examines a specified number of character positions.

  • value The string to seek.
  • startIndex The search starting position.
  • count The number of character positions to examine.
  • Returns The zero-based index position of from the start of the current instance if that string is found, or -1 if it is not. If is , the return value is .

public int IndexOf( string value, int startIndex, int count, StringComparison comparisonType )

Reports the zero-based index of the first occurrence of the specified string in the current 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.

  • value The string to seek.
  • startIndex The search starting position.
  • count The number of character positions to examine.
  • comparisonType One of the enumeration values that specifies the rules for the search.
  • Returns The zero-based index position of the parameter from the start of the current instance if that string is found, or -1 if it is not. If is , the return value is .

public int IndexOf( string value, int startIndex, StringComparison comparisonType )

Reports the zero-based index of the first occurrence of the specified string in the current object. Parameters specify the starting search position in the current string and the type of search to use for the specified string.

  • value The string to seek.
  • startIndex The search starting position.
  • comparisonType One of the enumeration values that specifies the rules for the search.
  • Returns The zero-based index position of the parameter from the start of the current instance if that string is found, or -1 if it is not. If is , the return value is .

public int IndexOf( string value, StringComparison comparisonType )

Reports the zero-based index of the first occurrence of the specified string in the current object. A parameter specifies the type of search to use for the specified string.

  • value The string to seek.
  • comparisonType One of the enumeration values that specifies the rules for the search.
  • Returns The index position of the parameter if that string is found, or -1 if it is not. If is , the return value is 0.

public int IndexOfAny( char[] anyOf )

Reports the zero-based index of the first occurrence in this instance of any character in a specified array of Unicode characters.

  • anyOf A Unicode character array containing one or more characters to seek.
  • Returns The zero-based index position of the first occurrence in this instance where any character in was found; -1 if no character in was found.

public int IndexOfAny( char[] anyOf, int startIndex )

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.

  • anyOf A Unicode character array containing one or more characters to seek.
  • startIndex The search starting position.
  • Returns The zero-based index position of the first occurrence in this instance where any character in was found; -1 if no character in was found.

public int IndexOfAny( char[] anyOf, int startIndex, int count )

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.

  • anyOf A Unicode character array containing one or more characters to seek.
  • startIndex The search starting position.
  • count The number of character positions to examine.
  • Returns The zero-based index position of the first occurrence in this instance where any character in was found; -1 if no character in was found.

public string Insert( int startIndex, string value )

Returns a new string in which a specified string is inserted at a specified index position in this instance.

  • startIndex The zero-based index position of the insertion.
  • value The string to insert.
  • Returns A new string that is equivalent to this instance, but with inserted at position .

public static string Intern( string str )

Retrieves the system's reference to the specified .

  • str A string to search for in the intern pool.
  • Returns The system's reference to , if it is interned; otherwise, a new reference to a string with the value of .

public static string IsInterned( string str )

Retrieves a reference to a specified .

  • str The string to search for in the intern pool.
  • Returns A reference to if it is in the common language runtime intern pool; otherwise, .

public bool IsNormalized( NormalizationForm normalizationForm )

Indicates whether this string is in the specified Unicode normalization form.

  • normalizationForm A Unicode normalization form.
  • Returns if this string is in the normalization form specified by the parameter; otherwise, .

public static bool IsNullOrEmpty( string value )

Indicates whether the specified string is or an empty string ("").

  • value The string to test.
  • Returns if the parameter is or an empty string (""); otherwise, .

public static bool IsNullOrWhiteSpace( string value )

Indicates whether a specified string is , empty, or consists only of white-space characters.

  • value The string to test.
  • Returns if the parameter is or , or if consists exclusively of white-space characters.

public static string Join( char separator, object[] values )

No summary.

public static string Join( char separator, string[] value )

No summary.

public static string Join( char separator, string[] value, int startIndex, int count )

No summary.

public static string Join( string separator, object[] values )

Concatenates the elements of an object array, using the specified separator between each element.

  • separator The string to use as a separator. is included in the returned string only if has more than one element.
  • values An array that contains the elements to concatenate.
  • Returns A string that consists of the elements of delimited by the string. If is an empty array, the method returns .

public static string Join( string separator, string[] value )

Concatenates all the elements of a string array, using the specified separator between each element.

  • separator The string to use as a separator. is included in the returned string only if has more than one element.
  • value An array that contains the elements to concatenate.
  • Returns A string that consists of the elements in delimited by the string. If is an empty array, the method returns .

public static string Join( string separator, string[] value, int startIndex, int count )

Concatenates the specified elements of a string array, using the specified separator between each element.

  • separator The string to use as a separator. is included in the returned string only if has more than one element.
  • value An array that contains the elements to concatenate.
  • startIndex The first element in to use.
  • count The number of elements of to use.
  • Returns A string that consists of the strings in delimited by the string. -or- if is zero, has no elements, or and all the elements of are .

public int LastIndexOf( char value )

Reports the zero-based index position of the last occurrence of a specified Unicode character within this instance.

  • value The Unicode character to seek.
  • Returns The zero-based index position of if that character is found, or -1 if it is not.

public int LastIndexOf( char value, int startIndex )

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.

  • value The Unicode character to seek.
  • startIndex The starting position of the search. The search proceeds from toward the beginning of this instance.
  • Returns The zero-based index position of if that character is found, or -1 if it is not found or if the current instance equals .

public int LastIndexOf( char value, int startIndex, int count )

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.

  • value The Unicode character to seek.
  • startIndex The starting position of the search. The search proceeds from toward the beginning of this instance.
  • count The number of character positions to examine.
  • Returns The zero-based index position of if that character is found, or -1 if it is not found or if the current instance equals .

public int LastIndexOf( string value )

Reports the zero-based index position of the last occurrence of a specified string within this instance.

  • value The string to seek.
  • Returns The zero-based starting index position of if that string is found, or -1 if it is not. If is , the return value is the last index position in this instance.

public int LastIndexOf( string value, int startIndex )

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.

  • value The string to seek.
  • startIndex The search starting position. The search proceeds from toward the beginning of this instance.
  • Returns The zero-based starting index position of if that string is found, or -1 if it is not found or if the current instance equals . If is , the return value is the smaller of and the last index position in this instance.

public int LastIndexOf( string value, int startIndex, int count )

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.

  • value The string to seek.
  • startIndex The search starting position. The search proceeds from toward the beginning of this instance.
  • count The number of character positions to examine.
  • Returns The zero-based starting index position of if that string is found, or -1 if it is not found or if the current instance equals . If is , the return value is the smaller of and the last index position in this instance.

public int LastIndexOf( string value, int startIndex, int count, StringComparison comparisonType )

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.

  • value The string to seek.
  • startIndex The search starting position. The search proceeds from toward the beginning of this instance.
  • count The number of character positions to examine.
  • comparisonType One of the enumeration values that specifies the rules for the search.
  • Returns The zero-based starting index position of the parameter if that string is found, or -1 if it is not found or if the current instance equals . If is , the return value is the smaller of and the last index position in this instance.

public int LastIndexOf( string value, int startIndex, StringComparison comparisonType )

Reports the zero-based index of the last occurrence of a specified string within the current object. 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.

  • value The string to seek.
  • startIndex The search starting position. The search proceeds from toward the beginning of this instance.
  • comparisonType One of the enumeration values that specifies the rules for the search.
  • Returns The zero-based starting index position of the parameter if that string is found, or -1 if it is not found or if the current instance equals . If is , the return value is the smaller of and the last index position in this instance.

public int LastIndexOf( string value, StringComparison comparisonType )

Reports the zero-based index of the last occurrence of a specified string within the current object. A parameter specifies the type of search to use for the specified string.

  • value The string to seek.
  • comparisonType One of the enumeration values that specifies the rules for the search.
  • Returns The zero-based starting index position of the parameter if that string is found, or -1 if it is not. If is , the return value is the last index position in this instance.

public int LastIndexOfAny( char[] anyOf )

Reports the zero-based index position of the last occurrence in this instance of one or more characters specified in a Unicode array.

  • anyOf A Unicode character array containing one or more characters to seek.
  • Returns The index position of the last occurrence in this instance where any character in was found; -1 if no character in was found.

public int LastIndexOfAny( char[] anyOf, int startIndex )

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.

  • anyOf A Unicode character array containing one or more characters to seek.
  • startIndex The search starting position. The search proceeds from toward the beginning of this instance.
  • Returns The index position of the last occurrence in this instance where any character in was found; -1 if no character in was found or if the current instance equals .

public int LastIndexOfAny( char[] anyOf, int startIndex, int count )

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 for a specified number of character positions.

  • anyOf A Unicode character array containing one or more characters to seek.
  • startIndex The search starting position. The search proceeds from toward the beginning of this instance.
  • count The number of character positions to examine.
  • Returns The index position of the last occurrence in this instance where any character in was found; -1 if no character in was found or if the current instance equals .

public int Length { get; }

Gets the number of characters in the current object.

  • Returns The number of characters in the current string.

public string Normalize( NormalizationForm normalizationForm )

Returns a new string whose textual value is the same as this string, but whose binary representation is in the specified Unicode normalization form.

  • normalizationForm A Unicode normalization form.
  • Returns A new string whose textual value is the same as this string, but whose binary representation is in the normalization form specified by the parameter.

public static bool op_Equality( string a, string b )

Determines whether two specified strings have the same value.

  • a The first string to compare, or .
  • b The second string to compare, or .
  • Returns if the value of is the same as the value of ; otherwise, .

public static bool op_Inequality( string a, string b )

Determines whether two specified strings have different values.

  • a The first string to compare, or .
  • b The second string to compare, or .
  • Returns if the value of is different from the value of ; otherwise, .

public string PadLeft( int totalWidth )

Returns a new string that right-aligns the characters in this instance by padding them with spaces on the left, for a specified total length.

  • totalWidth The number of characters in the resulting string, equal to the number of original characters plus any additional padding characters.
  • Returns A new string that is equivalent to this instance, but right-aligned and padded on the left with as many spaces as needed to create a length of . However, if is less than the length of this instance, the method returns a reference to the existing instance. If is equal to the length of this instance, the method returns a new string that is identical to this instance.

public string PadLeft( int totalWidth, char paddingChar )

Returns a new string that right-aligns the characters in this instance by padding them on the left with a specified Unicode character, for a specified total length.

  • totalWidth The number of characters in the resulting string, equal to the number of original characters plus any additional padding characters.
  • paddingChar A Unicode padding character.
  • Returns A new string that is equivalent to this instance, but right-aligned and padded on the left with as many characters as needed to create a length of . However, if is less than the length of this instance, the method returns a reference to the existing instance. If is equal to the length of this instance, the method returns a new string that is identical to this instance.

public string PadRight( int totalWidth )

Returns a new string that left-aligns the characters in this string by padding them with spaces on the right, for a specified total length.

  • totalWidth The number of characters in the resulting string, equal to the number of original characters plus any additional padding characters.
  • Returns A new string that is equivalent to this instance, but left-aligned and padded on the right with as many spaces as needed to create a length of . However, if is less than the length of this instance, the method returns a reference to the existing instance. If is equal to the length of this instance, the method returns a new string that is identical to this instance.

public string PadRight( int totalWidth, char paddingChar )

Returns a new string that left-aligns the characters in this string by padding them on the right with a specified Unicode character, for a specified total length.

  • totalWidth The number of characters in the resulting string, equal to the number of original characters plus any additional padding characters.
  • paddingChar A Unicode padding character.
  • Returns A new string that is equivalent to this instance, but left-aligned and padded on the right with as many characters as needed to create a length of . However, if is less than the length of this instance, the method returns a reference to the existing instance. If is equal to the length of this instance, the method returns a new string that is identical to this instance.

public string Remove( int startIndex )

Returns a new string in which all the characters in the current instance, beginning at a specified position and continuing through the last position, have been deleted.

  • startIndex The zero-based position to begin deleting characters.
  • Returns A new string that is equivalent to this string except for the removed characters.

public string Remove( int startIndex, int count )

Returns a new string in which a specified number of characters in the current instance beginning at a specified position have been deleted.

  • startIndex The zero-based position to begin deleting characters.
  • count The number of characters to delete.
  • Returns A new string that is equivalent to this instance except for the removed characters.

public string Replace( char oldChar, char newChar )

Returns a new string in which all occurrences of a specified Unicode character in this instance are replaced with another specified Unicode character.

  • oldChar The Unicode character to be replaced.
  • newChar The Unicode character to replace all occurrences of .
  • Returns A string that is equivalent to this instance except that all instances of are replaced with . If is not found in the current instance, the method returns the current instance unchanged.

public string Replace( string oldValue, string newValue )

Returns a new string in which all occurrences of a specified string in the current instance are replaced with another specified string.

  • oldValue The string to be replaced.
  • newValue The string to replace all occurrences of .
  • Returns A string that is equivalent to the current string except that all instances of are replaced with . If is not found in the current instance, the method returns the current instance unchanged.

public string Replace( string oldValue, string newValue, bool ignoreCase, CultureInfo culture )

No summary.

public string Replace( string oldValue, string newValue, StringComparison comparisonType )

No summary.

public string[] Split( char separator, int count, StringSplitOptions options = None )

No summary.

public string[] Split( char separator, StringSplitOptions options = None )

No summary.

public string[] Split( char[] separator )

Splits a string into substrings that are based on the characters in an array.

  • separator A character array that delimits the substrings in this string, an empty array that contains no delimiters, or .
  • Returns An array whose elements contain the substrings from this instance that are delimited by one or more characters in . For more information, see the Remarks section.

public string[] Split( char[] separator, int count )

Splits a string into a maximum number of substrings based on the characters in an array. You also specify the maximum number of substrings to return.

  • separator A character array that delimits the substrings in this string, an empty array that contains no delimiters, or .
  • count The maximum number of substrings to return.
  • Returns An array whose elements contain the substrings in this instance that are delimited by one or more characters in . For more information, see the Remarks section.

public string[] Split( char[] separator, int count, StringSplitOptions options )

Splits a string into a maximum number of substrings based on the characters in an array.

  • separator A character array that delimits the substrings in this string, an empty array that contains no delimiters, or .
  • count The maximum number of substrings to return.
  • options to omit empty array elements from the array returned; or to include empty array elements in the array returned.
  • Returns An array whose elements contain the substrings in this string that are delimited by one or more characters in . For more information, see the Remarks section.

public string[] Split( char[] separator, StringSplitOptions options )

Splits a string into substrings based on the characters in an array. You can specify whether the substrings include empty array elements.

  • separator A character array that delimits the substrings in this string, an empty array that contains no delimiters, or .
  • options to omit empty array elements from the array returned; or to include empty array elements in the array returned.
  • Returns An array whose elements contain the substrings in this string that are delimited by one or more characters in . For more information, see the Remarks section.

public string[] Split( string separator, int count, StringSplitOptions options = None )

No summary.

public string[] Split( string separator, StringSplitOptions options = None )

No summary.

public string[] Split( string[] separator, int count, StringSplitOptions options )

Splits a string into a maximum number of substrings based on the strings in an array. You can specify whether the substrings include empty array elements.

  • separator A string array that delimits the substrings in this string, an empty array that contains no delimiters, or .
  • count The maximum number of substrings to return.
  • options to omit empty array elements from the array returned; or to include empty array elements in the array returned.
  • Returns An array whose elements contain the substrings in this string that are delimited by one or more strings in . For more information, see the Remarks section.

public string[] Split( string[] separator, StringSplitOptions options )

Splits a string into substrings based on the strings in an array. You can specify whether the substrings include empty array elements.

  • separator A string array that delimits the substrings in this string, an empty array that contains no delimiters, or .
  • options to omit empty array elements from the array returned; or to include empty array elements in the array returned.
  • Returns An array whose elements contain the substrings in this string that are delimited by one or more strings in . For more information, see the Remarks section.

public bool StartsWith( char value )

No summary.

public bool StartsWith( string value )

Determines whether the beginning of this string instance matches the specified string.

  • value The string to compare.
  • Returns if matches the beginning of this string; otherwise, .

public bool StartsWith( string value, bool ignoreCase, CultureInfo culture )

Determines whether the beginning of this string instance matches the specified string when compared using the specified culture.

  • value The string to compare.
  • ignoreCase to ignore case during the comparison; otherwise, .
  • culture Cultural information that determines how this string and are compared. If is , the current culture is used.
  • Returns if the parameter matches the beginning of this string; otherwise, .

public bool StartsWith( string value, StringComparison comparisonType )

Determines whether the beginning of this string instance matches the specified string when compared using the specified comparison option.

  • value The string to compare.
  • comparisonType One of the enumeration values that determines how this string and are compared.
  • Returns if this instance begins with ; otherwise, .

public string Substring( int startIndex )

Retrieves a substring from this instance. The substring starts at a specified character position and continues to the end of the string.

  • startIndex The zero-based starting character position of a substring in this instance.
  • Returns A string that is equivalent to the substring that begins at in this instance, or if is equal to the length of this instance.

public string Substring( int startIndex, int length )

Retrieves a substring from this instance. The substring starts at a specified character position and has a specified length.

  • startIndex The zero-based starting character position of a substring in this instance.
  • length The number of characters in the substring.
  • Returns A string that is equivalent to the substring of length that begins at in this instance, or if is equal to the length of this instance and is zero.

public char[] ToCharArray( int startIndex, int length )

Copies the characters in a specified substring in this instance to a Unicode character array.

  • startIndex The starting position of a substring in this instance.
  • length The length of the substring in this instance.
  • Returns A Unicode character array whose elements are the number of characters in this instance starting from character position .

public string ToLower( CultureInfo culture )

Returns a copy of this string converted to lowercase, using the casing rules of the specified culture.

  • culture An object that supplies culture-specific casing rules.
  • Returns The lowercase equivalent of the current string.

public string ToString( IFormatProvider provider )

Returns this instance of ; no actual conversion is performed.

  • provider (Reserved) An object that supplies culture-specific formatting information.
  • Returns The current string.

public string ToUpper( CultureInfo culture )

Returns a copy of this string converted to uppercase, using the casing rules of the specified culture.

  • culture An object that supplies culture-specific casing rules.
  • Returns The uppercase equivalent of the current string.

public string Trim( char trimChar )

No summary.

public string Trim( char[] trimChars )

Removes all leading and trailing occurrences of a set of characters specified in an array from the current object.

  • trimChars An array of Unicode characters to remove, or .
  • Returns The string that remains after all occurrences of the characters in the parameter are removed from the start and end of the current string. If is or an empty array, white-space characters are removed instead. If no characters can be trimmed from the current instance, the method returns the current instance unchanged.

public string TrimEnd( char trimChar )

No summary.

public string TrimEnd( char[] trimChars )

Removes all trailing occurrences of a set of characters specified in an array from the current object.

  • trimChars An array of Unicode characters to remove, or .
  • Returns The string that remains after all occurrences of the characters in the parameter are removed from the end of the current string. If is or an empty array, Unicode white-space characters are removed instead. If no characters can be trimmed from the current instance, the method returns the current instance unchanged.

public string TrimStart( char trimChar )

No summary.

public string TrimStart( char[] trimChars )

Removes all leading occurrences of a set of characters specified in an array from the current object.

  • trimChars An array of Unicode characters to remove, or .
  • Returns The string that remains after all occurrences of characters in the parameter are removed from the start of the current string. If is or an empty array, white-space characters are removed instead.

public static string Format( IFormatProvider provider, CompositeFormat format, object[] args )

😔 No documentation found.

public static string Format( IFormatProvider provider, CompositeFormat format, ReadOnlySpan<object> args )

😔 No documentation found.

public static string Format( IFormatProvider provider, CompositeFormat format, TArg0 arg0, TArg1 arg1 )

😔 No documentation found.

public static string Format( IFormatProvider provider, CompositeFormat format, TArg0 arg0 )

😔 No documentation found.

public StringRuneEnumerator EnumerateRunes( )

😔 No documentation found.

public static string Join( char separator, ReadOnlySpan<string> value )

😔 No documentation found.

public string( ReadOnlySpan<char> value )

😔 No documentation found.

public static string Create( int length, TState state, SpanAction<char,TState> action )

😔 No documentation found.

public static string Format( IFormatProvider provider, string format, ReadOnlySpan<object> args )

😔 No documentation found.

public static string Format( IFormatProvider provider, CompositeFormat format, TArg0 arg0, TArg1 arg1, TArg2 arg2 )

😔 No documentation found.

public static string Create( IFormatProvider provider, Span<char> initialBuffer, ref DefaultInterpolatedStringHandler handler )

😔 No documentation found.

public static string Create( IFormatProvider provider, ref DefaultInterpolatedStringHandler handler )

😔 No documentation found.

public bool IsNormalized( )

😔 No documentation found.

public string Normalize( )

😔 No documentation found.

public static string Format( string format, ReadOnlySpan<object> args )

😔 No documentation found.

public char Chars { get; }

😔 No documentation found.

public Type GetType( )

😔 No documentation found.

public static string Concat( ReadOnlySpan<object> args )

😔 No documentation found.

public static string Concat( ReadOnlySpan<string> values )

😔 No documentation found.

public static int GetHashCode( ReadOnlySpan<char> value, StringComparison comparisonType )

😔 No documentation found.

public static int GetHashCode( ReadOnlySpan<char> value )

😔 No documentation found.

public int GetHashCode( )

😔 No documentation found.

public static string Concat( IEnumerable<T> values )

😔 No documentation found.

public static string Concat( ReadOnlySpan<char> str0, ReadOnlySpan<char> str1, ReadOnlySpan<char> str2, ReadOnlySpan<char> str3 )

😔 No documentation found.

public static string Concat( ReadOnlySpan<char> str0, ReadOnlySpan<char> str1, ReadOnlySpan<char> str2 )

😔 No documentation found.

public TypeCode GetTypeCode( )

😔 No documentation found.

public static string Concat( ReadOnlySpan<char> str0, ReadOnlySpan<char> str1 )

😔 No documentation found.

public char[] ToCharArray( )

😔 No documentation found.

public string ReplaceLineEndings( string replacementText )

😔 No documentation found.

public string ReplaceLineEndings( )

😔 No documentation found.

public static string Join( string separator, IEnumerable<T> values )

😔 No documentation found.

public static string Join( char separator, IEnumerable<T> values )

😔 No documentation found.

public static string Join( string separator, ReadOnlySpan<object> values )

😔 No documentation found.

public static string Join( char separator, ReadOnlySpan<object> values )

😔 No documentation found.

public static string Concat( IEnumerable<string> values )

😔 No documentation found.

public string ToLower( )

😔 No documentation found.

public string ToLowerInvariant( )

😔 No documentation found.

public string ToUpper( )

😔 No documentation found.

public string ToUpperInvariant( )

😔 No documentation found.

public string Trim( )

😔 No documentation found.

public static ReadOnlySpan<char> op_Implicit( string value )

😔 No documentation found.

public string Trim( ReadOnlySpan<char> trimChars )

😔 No documentation found.

public string TrimStart( ReadOnlySpan<char> trimChars )

😔 No documentation found.

public string TrimEnd( )

😔 No documentation found.

public string TrimEnd( ReadOnlySpan<char> trimChars )

😔 No documentation found.

public CharEnumerator GetEnumerator( )

😔 No documentation found.

public string ToString( )

😔 No documentation found.

public ref char GetPinnableReference( )

😔 No documentation found.

public static string Join( string separator, IEnumerable<string> values )

😔 No documentation found.

public static string Join( string separator, ReadOnlySpan<string> value )

😔 No documentation found.

public string[] Split( ReadOnlySpan<char> separator )

😔 No documentation found.

public bool TryCopyTo( Span<char> destination )

😔 No documentation found.

public void CopyTo( Span<char> destination )

😔 No documentation found.

public string TrimStart( )

😔 No documentation found.

public object Clone( )

😔 No documentation found.