class string
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.
valueA 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.
valueA pointer to an array of Unicode characters.startIndexThe starting position within .lengthThe 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.
cA Unicode character.countThe 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.
valueAn 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.
valueAn array of Unicode characters.startIndexThe starting position within .lengthThe 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.
valueA 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.
valueA 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 ).startIndexThe starting position within .lengthThe 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.
valueA pointer to an array of 8-bit signed integers.startIndexThe starting position within .lengthThe number of characters within to use.encAn 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.
strAThe first string to use in the comparison.indexAThe position of the substring within .strBThe second string to use in the comparison.indexBThe position of the substring within .lengthThe 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.
strAThe first string to use in the comparison.indexAThe position of the substring within .strBThe second string to use in the comparison.indexBThe position of the substring within .lengthThe maximum number of characters in the substrings to compare.ignoreCaseto 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.
strAThe first string to use in the comparison.indexAThe position of the substring within .strBThe second string to use in the comparison.indexBThe position of the substring within .lengthThe maximum number of characters in the substrings to compare.ignoreCaseto ignore case during the comparison; otherwise, .cultureAn 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.
strAThe first string to use in the comparison.indexAThe starting position of the substring within .strBThe second string to use in the comparison.indexBThe starting position of the substring within .lengthThe maximum number of characters in the substrings to compare.cultureAn object that supplies culture-specific comparison information.optionsOptions 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.
strAThe first string to use in the comparison.indexAThe position of the substring within .strBThe second string to use in the comparison.indexBThe position of the substring within .lengthThe maximum number of characters in the substrings to compare.comparisonTypeOne 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.
strAThe first string to compare.strBThe 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.
strAThe first string to compare.strBThe second string to compare.ignoreCaseto 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.
strAThe first string to compare.strBThe second string to compare.ignoreCaseto ignore case during the comparison; otherwise, .cultureAn 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.
strAThe first string to compare.strBThe second string to compare.cultureThe culture that supplies culture-specific comparison information.optionsOptions 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.
strAThe first string to compare.strBThe second string to compare.comparisonTypeOne 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.
strAThe first string to use in the comparison.indexAThe starting index of the substring in .strBThe second string to use in the comparison.indexBThe starting index of the substring in .lengthThe 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.
strAThe first string to compare.strBThe 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 .
valueAn 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.
strBThe 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.
arg0The 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.
arg0The first object to concatenate.arg1The 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.
arg0The first object to concatenate.arg1The second object to concatenate.arg2The 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.
argsAn 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 .
str0The first string to concatenate.str1The second string to concatenate.- Returns The concatenation of and .
public static string Concat( string str0, string str1, string str2 )
Concatenates three specified instances of .
str0The first string to concatenate.str1The second string to concatenate.str2The 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 .
str0The first string to concatenate.str1The second string to concatenate.str2The third string to concatenate.str3The fourth string to concatenate.- Returns The concatenation of , , , and .
public static string Concat( string[] values )
Concatenates the elements of a specified array.
valuesAn 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.
valueThe 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.
valueThe character to seek.comparisonTypeOne 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.
valueThe 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.
valueThe string to seek.comparisonTypeOne 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 .
strThe 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.
sourceIndexThe index of the first character in this instance to copy.destinationAn array of Unicode characters to which characters in this instance are copied.destinationIndexThe index in at which the copy operation begins.countThe 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.
valueThe 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.
valueThe string to compare to the substring at the end of this instance.ignoreCaseto ignore case during the comparison; otherwise, .cultureCultural 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.
valueThe string to compare to the substring at the end of this instance.comparisonTypeOne 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.
objThe 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.
valueThe 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.
aThe first string to compare, or .bThe 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.
aThe first string to compare, or .bThe second string to compare, or .comparisonTypeOne 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.
valueThe string to compare to this instance.comparisonTypeOne 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.
providerAn object that supplies culture-specific formatting information.formatA composite format string.arg0The 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.
providerAn object that supplies culture-specific formatting information.formatA composite format string.arg0The first object to format.arg1The 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.
providerAn object that supplies culture-specific formatting information.formatA composite format string.arg0The first object to format.arg1The second object to format.arg2The 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.
providerAn object that supplies culture-specific formatting information.formatA composite format string.argsAn 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.
formatA composite format string.arg0The 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.
formatA composite format string.arg0The first object to format.arg1The 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.
formatA composite format string.arg0The first object to format.arg1The second object to format.arg2The 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.
formatA composite format string.argsAn 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.
comparisonTypeOne 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.
valueA 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.
valueA Unicode character to seek.startIndexThe 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.
valueA Unicode character to seek.startIndexThe search starting position.countThe 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.
valueThe character to seek.comparisonTypeAn 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.
valueThe 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.
valueThe string to seek.startIndexThe 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.
valueThe string to seek.startIndexThe search starting position.countThe 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.
valueThe string to seek.startIndexThe search starting position.countThe number of character positions to examine.comparisonTypeOne 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.
valueThe string to seek.startIndexThe search starting position.comparisonTypeOne 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.
valueThe string to seek.comparisonTypeOne 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.
anyOfA 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.
anyOfA Unicode character array containing one or more characters to seek.startIndexThe 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.
anyOfA Unicode character array containing one or more characters to seek.startIndexThe search starting position.countThe 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.
startIndexThe zero-based index position of the insertion.valueThe 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 .
strA 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 .
strThe 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.
normalizationFormA 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 ("").
valueThe 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.
valueThe 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.
separatorThe string to use as a separator. is included in the returned string only if has more than one element.valuesAn 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.
separatorThe string to use as a separator. is included in the returned string only if has more than one element.valueAn 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.
separatorThe string to use as a separator. is included in the returned string only if has more than one element.valueAn array that contains the elements to concatenate.startIndexThe first element in to use.countThe 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.
valueThe 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.
valueThe Unicode character to seek.startIndexThe 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.
valueThe Unicode character to seek.startIndexThe starting position of the search. The search proceeds from toward the beginning of this instance.countThe 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.
valueThe 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.
valueThe string to seek.startIndexThe 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.
valueThe string to seek.startIndexThe search starting position. The search proceeds from toward the beginning of this instance.countThe 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.
valueThe string to seek.startIndexThe search starting position. The search proceeds from toward the beginning of this instance.countThe number of character positions to examine.comparisonTypeOne 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.
valueThe string to seek.startIndexThe search starting position. The search proceeds from toward the beginning of this instance.comparisonTypeOne 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.
valueThe string to seek.comparisonTypeOne 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.
anyOfA 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.
anyOfA Unicode character array containing one or more characters to seek.startIndexThe 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.
anyOfA Unicode character array containing one or more characters to seek.startIndexThe search starting position. The search proceeds from toward the beginning of this instance.countThe 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.
normalizationFormA 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.
aThe first string to compare, or .bThe 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.
aThe first string to compare, or .bThe 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.
totalWidthThe 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.
totalWidthThe number of characters in the resulting string, equal to the number of original characters plus any additional padding characters.paddingCharA 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.
totalWidthThe 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.
totalWidthThe number of characters in the resulting string, equal to the number of original characters plus any additional padding characters.paddingCharA 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.
startIndexThe 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.
startIndexThe zero-based position to begin deleting characters.countThe 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.
oldCharThe Unicode character to be replaced.newCharThe 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.
oldValueThe string to be replaced.newValueThe 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.
separatorA 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.
separatorA character array that delimits the substrings in this string, an empty array that contains no delimiters, or .countThe 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.
separatorA character array that delimits the substrings in this string, an empty array that contains no delimiters, or .countThe maximum number of substrings to return.optionsto 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.
separatorA character array that delimits the substrings in this string, an empty array that contains no delimiters, or .optionsto 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.
separatorA string array that delimits the substrings in this string, an empty array that contains no delimiters, or .countThe maximum number of substrings to return.optionsto 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.
separatorA string array that delimits the substrings in this string, an empty array that contains no delimiters, or .optionsto 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.
valueThe 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.
valueThe string to compare.ignoreCaseto ignore case during the comparison; otherwise, .cultureCultural 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.
valueThe string to compare.comparisonTypeOne 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.
startIndexThe 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.
startIndexThe zero-based starting character position of a substring in this instance.lengthThe 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.
startIndexThe starting position of a substring in this instance.lengthThe 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.
cultureAn 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.
cultureAn 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.
trimCharsAn 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.
trimCharsAn 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.
trimCharsAn 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.