mscorlib(4.0.0.0) API with additions
|
Represents text as a sequence of UTF-16 code units.To browse the .NET Framework source code for this type, see the Reference Source. More...
Public Member Functions | |
override bool | Equals (object obj) |
Determines whether this instance and a specified object, which must also be a T:System.String object, have the same value. More... | |
bool | Equals (string value) |
Determines whether this instance and another specified T:System.String object have the same value. More... | |
bool | Equals (string value, StringComparison comparisonType) |
Determines whether this string and a specified T:System.String object have the same value. A parameter specifies the culture, case, and sort rules used in the comparison. More... | |
unsafe 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. More... | |
unsafe char [] | ToCharArray () |
Copies the characters in this instance to a Unicode character array. More... | |
unsafe char [] | ToCharArray (int startIndex, int length) |
Copies the characters in a specified substring in this instance to a Unicode character array. More... | |
unsafe override int | GetHashCode () |
Returns the hash code for this string. More... | |
string [] | Split (params char[] separator) |
Splits a string into substrings that are based on the characters in an array. More... | |
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. More... | |
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. More... | |
string [] | Split (char[] separator, int count, StringSplitOptions options) |
Splits a string into a maximum number of substrings based on the characters in an array. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
string | Trim (params char[] trimChars) |
Removes all leading and trailing occurrences of a set of characters specified in an array from the current T:System.String object. More... | |
string | TrimStart (params char[] trimChars) |
Removes all leading occurrences of a set of characters specified in an array from the current T:System.String object. More... | |
string | TrimEnd (params char[] trimChars) |
Removes all trailing occurrences of a set of characters specified in an array from the current T:System.String object. More... | |
unsafe | String (char *value) |
Initializes a new instance of the T:System.String class to the value indicated by a specified pointer to an array of Unicode characters. More... | |
unsafe | String (char *value, int startIndex, int length) |
Initializes a new instance of the T:System.String class to the value indicated by a specified pointer to an array of Unicode characters, a starting character position within that array, and a length. More... | |
unsafe | String (sbyte *value) |
Initializes a new instance of the T:System.String class to the value indicated by a pointer to an array of 8-bit signed integers. More... | |
unsafe | String (sbyte *value, int startIndex, int length) |
Initializes a new instance of the T:System.String 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. More... | |
unsafe | String (sbyte *value, int startIndex, int length, Encoding enc) |
Initializes a new instance of the T:System.String 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 T:System.Text.Encoding object. More... | |
bool | IsNormalized () |
Indicates whether this string is in Unicode normalization form C. More... | |
bool | IsNormalized (NormalizationForm normalizationForm) |
Indicates whether this string is in the specified Unicode normalization form. More... | |
string | Normalize () |
Returns a new string whose textual value is the same as this string, but whose binary representation is in Unicode normalization form C. More... | |
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. More... | |
String (char[] value, int startIndex, int length) | |
Initializes a new instance of the T:System.String class to the value indicated by an array of Unicode characters, a starting character position within that array, and a length. More... | |
String (char[] value) | |
Initializes a new instance of the T:System.String class to the value indicated by an array of Unicode characters. More... | |
String (char c, int count) | |
Initializes a new instance of the T:System.String class to the value indicated by a specified Unicode character repeated a specified number of times. More... | |
int | CompareTo (object value) |
Compares this instance with a specified T:System.Object and indicates whether this instance precedes, follows, or appears in the same position in the sort order as the specified T:System.Object. More... | |
int | CompareTo (string strB) |
Compares this instance with a specified T:System.String object and indicates whether this instance precedes, follows, or appears in the same position in the sort order as the specified string. More... | |
bool | Contains (string value) |
Returns a value indicating whether a specified substring occurs within this string. More... | |
bool | EndsWith (string value) |
Determines whether the end of this string instance matches the specified string. More... | |
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. More... | |
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. More... | |
int | IndexOf (char value) |
Reports the zero-based index of the first occurrence of the specified Unicode character in this string. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
int | IndexOf (string value) |
Reports the zero-based index of the first occurrence of the specified string in this instance. More... | |
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. More... | |
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. More... | |
int | IndexOf (string value, StringComparison comparisonType) |
Reports the zero-based index of the first occurrence of the specified string in the current T:System.String object. A parameter specifies the type of search to use for the specified string. More... | |
int | IndexOf (string value, int startIndex, StringComparison comparisonType) |
Reports the zero-based index of the first occurrence of the specified string in the current T:System.String object. Parameters specify the starting search position in the current string and the type of search to use for the specified string. More... | |
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 T:System.String object. Parameters specify the starting search position in the current string, the number of characters in the current string to search, and the type of search to use for the specified string. More... | |
int | LastIndexOf (char value) |
Reports the zero-based index position of the last occurrence of a specified Unicode character within this instance. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
int | LastIndexOf (string value) |
Reports the zero-based index position of the last occurrence of a specified string within this instance. More... | |
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. More... | |
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. More... | |
int | LastIndexOf (string value, StringComparison comparisonType) |
Reports the zero-based index of the last occurrence of a specified string within the current T:System.String object. A parameter specifies the type of search to use for the specified string. More... | |
int | LastIndexOf (string value, int startIndex, StringComparison comparisonType) |
Reports the zero-based index of the last occurrence of a specified string within the current T:System.String 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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
bool | StartsWith (string value) |
Determines whether the beginning of this string instance matches the specified string. More... | |
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. More... | |
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. More... | |
string | ToLower () |
Returns a copy of this string converted to lowercase. More... | |
string | ToLower (CultureInfo culture) |
Returns a copy of this string converted to lowercase, using the casing rules of the specified culture. More... | |
string | ToLowerInvariant () |
Returns a copy of this T:System.String object converted to lowercase using the casing rules of the invariant culture. More... | |
string | ToUpper () |
Returns a copy of this string converted to uppercase. More... | |
string | ToUpper (CultureInfo culture) |
Returns a copy of this string converted to uppercase, using the casing rules of the specified culture. More... | |
string | ToUpperInvariant () |
Returns a copy of this T:System.String object converted to uppercase using the casing rules of the invariant culture. More... | |
override string | ToString () |
Returns this instance of T:System.String; no actual conversion is performed. More... | |
string | ToString (IFormatProvider provider) |
Returns this instance of T:System.String; no actual conversion is performed. More... | |
object | Clone () |
Returns a reference to this instance of T:System.String. More... | |
string | Trim () |
Removes all leading and trailing white-space characters from the current T:System.String object. More... | |
unsafe 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. More... | |
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. More... | |
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. More... | |
unsafe 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. More... | |
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. More... | |
TypeCode | GetTypeCode () |
Returns the T:System.TypeCode for class T:System.String. More... | |
CharEnumerator | GetEnumerator () |
Retrieves an object that can iterate through the individual characters in this string. More... | |
![]() | |
IEnumerator | GetEnumerator () |
Returns an enumerator that iterates through a collection. More... | |
![]() | |
bool | Equals (T other) |
Indicates whether the current object is equal to another object of the same type. More... | |
Static Public Member Functions | |
static string | Join (string separator, params string[] value) |
Concatenates all the elements of a string array, using the specified separator between each element. More... | |
static string | Join (string separator, params object[] values) |
Concatenates the elements of an object array, using the specified separator between each element. More... | |
static string | Join< T > (string separator, IEnumerable< T > values) |
Concatenates the members of a collection, using the specified separator between each member. More... | |
static string | Join (string separator, IEnumerable< string > values) |
Concatenates the members of a constructed T:System.Collections.Generic.IEnumerable`1 collection of type T:System.String, using the specified separator between each member. More... | |
static unsafe 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. More... | |
static bool | Equals (string a, string b) |
Determines whether two specified T:System.String objects have the same value. More... | |
static bool | Equals (string a, string b, StringComparison comparisonType) |
Determines whether two specified T:System.String objects have the same value. A parameter specifies the culture, case, and sort rules used in the comparison. More... | |
static bool | operator== (string a, string b) |
Determines whether two specified strings have the same value. More... | |
static bool | operator != (string a, string b) |
Determines whether two specified strings have different values. More... | |
static bool | IsNullOrEmpty (string value) |
Indicates whether the specified string is null or an F:System.String.Empty string. More... | |
static bool | IsNullOrWhiteSpace (string value) |
Indicates whether a specified string is null , empty, or consists only of white-space characters. More... | |
static int | Compare (string strA, string strB) |
Compares two specified T:System.String objects and returns an integer that indicates their relative position in the sort order. More... | |
static int | Compare (string strA, string strB, bool ignoreCase) |
Compares two specified T:System.String objects, ignoring or honoring their case, and returns an integer that indicates their relative position in the sort order. More... | |
static int | Compare (string strA, string strB, StringComparison comparisonType) |
Compares two specified T:System.String objects using the specified rules, and returns an integer that indicates their relative position in the sort order. More... | |
static int | Compare (string strA, string strB, CultureInfo culture, CompareOptions options) |
Compares two specified T:System.String objects using the specified comparison options and culture-specific information to influence the comparison, and returns an integer that indicates the relationship of the two strings to each other in the sort order. More... | |
static int | Compare (string strA, string strB, bool ignoreCase, CultureInfo culture) |
Compares two specified T:System.String 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. More... | |
static int | Compare (string strA, int indexA, string strB, int indexB, int length) |
Compares substrings of two specified T:System.String objects and returns an integer that indicates their relative position in the sort order. More... | |
static int | Compare (string strA, int indexA, string strB, int indexB, int length, bool ignoreCase) |
Compares substrings of two specified T:System.String objects, ignoring or honoring their case, and returns an integer that indicates their relative position in the sort order. More... | |
static int | Compare (string strA, int indexA, string strB, int indexB, int length, bool ignoreCase, CultureInfo culture) |
Compares substrings of two specified T:System.String 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. More... | |
static int | Compare (string strA, int indexA, string strB, int indexB, int length, CultureInfo culture, CompareOptions options) |
Compares substrings of two specified T:System.String objects using the specified comparison options and culture-specific information to influence the comparison, and returns an integer that indicates the relationship of the two substrings to each other in the sort order. More... | |
static int | Compare (string strA, int indexA, string strB, int indexB, int length, StringComparison comparisonType) |
Compares substrings of two specified T:System.String objects using the specified rules, and returns an integer that indicates their relative position in the sort order. More... | |
static int | CompareOrdinal (string strA, string strB) |
Compares two specified T:System.String objects by evaluating the numeric values of the corresponding T:System.Char objects in each string. More... | |
static int | CompareOrdinal (string strA, int indexA, string strB, int indexB, int length) |
Compares substrings of two specified T:System.String objects by evaluating the numeric values of the corresponding T:System.Char objects in each substring. More... | |
static string | Format (string format, object arg0) |
Replaces one or more format items in a specified string with the string representation of a specified object. More... | |
static string | Format (string format, object arg0, object arg1) |
Replaces the format items in a specified string with the string representation of two specified objects. More... | |
static string | Format (string format, object arg0, object arg1, object arg2) |
Replaces the format items in a specified string with the string representation of three specified objects. More... | |
static string | Format (string format, params object[] args) |
Replaces the format item in a specified string with the string representation of a corresponding object in a specified array. More... | |
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. More... | |
static string | Format (IFormatProvider provider, string format, object arg0, object arg1) |
Replaces the format items in a specified string with the string representation of two specified objects. A parameter supplies culture-specific formatting information. More... | |
static string | Format (IFormatProvider provider, string format, object arg0, object arg1, object arg2) |
Replaces the format items in a specified string with the string representation of three specified objects. An parameter supplies culture-specific formatting information. More... | |
static string | Format (IFormatProvider provider, string format, params object[] args) |
Replaces the format items in a specified string with the string representations of corresponding objects in a specified array. A parameter supplies culture-specific formatting information. More... | |
static unsafe string | Copy (string str) |
Creates a new instance of T:System.String with the same value as a specified T:System.String. More... | |
static string | Concat (object arg0) |
Creates the string representation of a specified object. More... | |
static string | Concat (object arg0, object arg1) |
Concatenates the string representations of two specified objects. More... | |
static string | Concat (object arg0, object arg1, object arg2) |
Concatenates the string representations of three specified objects. More... | |
static string | Concat (object arg0, object arg1, object arg2, object arg3, __arglist) |
static string | Concat (params object[] args) |
Concatenates the string representations of the elements in a specified T:System.Object array. More... | |
static string | Concat< T > (IEnumerable< T > values) |
Concatenates the members of an T:System.Collections.Generic.IEnumerable`1 implementation. More... | |
static string | Concat (IEnumerable< string > values) |
Concatenates the members of a constructed T:System.Collections.Generic.IEnumerable`1 collection of type T:System.String. More... | |
static string | Concat (string str0, string str1) |
Concatenates two specified instances of T:System.String. More... | |
static string | Concat (string str0, string str1, string str2) |
Concatenates three specified instances of T:System.String. More... | |
static string | Concat (string str0, string str1, string str2, string str3) |
Concatenates four specified instances of T:System.String. More... | |
static string | Concat (params string[] values) |
Concatenates the elements of a specified T:System.String array. More... | |
static string | Intern (string str) |
Retrieves the system's reference to the specified T:System.String. More... | |
static string | IsInterned (string str) |
Retrieves a reference to a specified T:System.String. More... | |
Static Public Attributes | |
static readonly string | Empty |
Represents the empty string. This field is read-only. More... | |
Properties | |
char | this[int index] [get] |
Gets the T:System.Char object at a specified position in the current T:System.String object. More... | |
int | Length [get] |
Gets the number of characters in the current T:System.String object. More... | |
Represents text as a sequence of UTF-16 code units.To browse the .NET Framework source code for this type, see the Reference Source.
unsafe System.String.String | ( | char * | value | ) |
Initializes a new instance of the T:System.String 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. |
T:System.ArgumentOutOfRangeException | The current process does not have read access to all the addressed characters. |
T:System.ArgumentException | value specifies an array that contains an invalid Unicode character, or value specifies an address less than 64000. |
unsafe System.String.String | ( | char * | value, |
int | startIndex, | ||
int | length | ||
) |
Initializes a new instance of the T:System.String class to the value indicated by a specified pointer to an array of Unicode characters, a starting character position within that array, and a length.
value | A pointer to an array of Unicode characters. |
startIndex | The starting position within value . |
length | The number of characters within value to use. |
T:System.ArgumentOutOfRangeException | startIndex or length is less than zero, value + startIndex cause a pointer overflow, or the current process does not have read access to all the addressed characters. |
T:System.ArgumentException | value specifies an array that contains an invalid Unicode character, or value + startIndex specifies an address less than 64000. |
unsafe System.String.String | ( | sbyte * | value | ) |
Initializes a new instance of the T:System.String 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 P:System.Text.Encoding.Default). |
T:System.ArgumentNullException | value is null . |
T:System.ArgumentException | A new instance of T:System.String could not be initialized using value , assuming value is encoded in ANSI. |
T:System.ArgumentOutOfRangeException | The length of the new string to initialize, which is determined by the null termination character of value , is too large to allocate. |
T:System.AccessViolationException | value specifies an invalid address. |
unsafe System.String.String | ( | sbyte * | value, |
int | startIndex, | ||
int | length | ||
) |
Initializes a new instance of the T:System.String 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 P:System.Text.Encoding.Default). |
startIndex | The starting position within value . |
length | The number of characters within value to use. |
T:System.ArgumentNullException | value is null . |
T:System.ArgumentOutOfRangeException | startIndex or length is less than zero. -or-The address specified by value + startIndex is too large for the current platform; that is, the address calculation overflowed. -or-The length of the new string to initialize is too large to allocate. |
T:System.ArgumentException | The address specified by value + startIndex is less than 64K.-or- A new instance of T:System.String could not be initialized using value , assuming value is encoded in ANSI. |
T:System.AccessViolationException | value , startIndex , and length collectively specify an invalid address. |
unsafe System.String.String | ( | sbyte * | value, |
int | startIndex, | ||
int | length, | ||
Encoding | enc | ||
) |
Initializes a new instance of the T:System.String 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 T:System.Text.Encoding object.
value | A pointer to an array of 8-bit signed integers. |
startIndex | The starting position within value . |
length | The number of characters within value to use. |
enc | An object that specifies how the array referenced by value is encoded. If enc is null , ANSI encoding is assumed. |
T:System.ArgumentNullException | value is null . |
T:System.ArgumentOutOfRangeException | startIndex or length is less than zero. -or-The address specified by value + startIndex is too large for the current platform; that is, the address calculation overflowed. -or-The length of the new string to initialize is too large to allocate. |
T:System.ArgumentException | The address specified by value + startIndex is less than 64K.-or- A new instance of T:System.String could not be initialized using value , assuming value is encoded as specified by enc . |
T:System.AccessViolationException | value , startIndex , and length collectively specify an invalid address. |
System.String.String | ( | char [] | value, |
int | startIndex, | ||
int | length | ||
) |
Initializes a new instance of the T:System.String 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 value . |
length | The number of characters within value to use. |
T:System.ArgumentNullException | value is null . |
T:System.ArgumentOutOfRangeException | startIndex or length is less than zero.-or- The sum of startIndex and length is greater than the number of elements in value . |
System.String.String | ( | char [] | value | ) |
Initializes a new instance of the T:System.String class to the value indicated by an array of Unicode characters.
value | An array of Unicode characters. |
System.String.String | ( | char | c, |
int | count | ||
) |
Initializes a new instance of the T:System.String 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 c occurs. |
T:System.ArgumentOutOfRangeException | count is less than zero. |
object System.String.Clone | ( | ) |
Returns a reference to this instance of T:System.String.
Implements System.ICloneable.
|
static |
Compares two specified T:System.String 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. |
|
static |
Compares two specified T:System.String 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 | true to ignore case during the comparison; otherwise, false . |
|
static |
Compares two specified T:System.String 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. |
T:System.ArgumentException | comparisonType is not a T:System.StringComparison value. |
T:System.NotSupportedException | T:System.StringComparison is not supported. |
|
static |
Compares two specified T:System.String objects using the specified comparison options and culture-specific information to influence the comparison, and returns an integer that indicates the relationship of the two strings to 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). |
T:System.ArgumentException | options is not a T:System.Globalization.CompareOptions value. |
T:System.ArgumentNullException | culture is null . |
|
static |
Compares two specified T:System.String 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 | true to ignore case during the comparison; otherwise, false . |
culture | An object that supplies culture-specific comparison information. |
T:System.ArgumentNullException | culture is null . |
|
static |
Compares substrings of two specified T:System.String 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 strA . |
strB | The second string to use in the comparison. |
indexB | The position of the substring within strB . |
length | The maximum number of characters in the substrings to compare. |
T:System.ArgumentOutOfRangeException | indexA is greater than strA .P:System.String.Length.-or- indexB is greater than strB .P:System.String.Length.-or- indexA , indexB , or length is negative. -or-Either indexA or indexB is null , and length is greater than zero. |
|
static |
Compares substrings of two specified T:System.String 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 strA . |
strB | The second string to use in the comparison. |
indexB | The position of the substring within strB . |
length | The maximum number of characters in the substrings to compare. |
ignoreCase | true to ignore case during the comparison; otherwise, false . |
T:System.ArgumentOutOfRangeException | indexA is greater than strA .P:System.String.Length.-or- indexB is greater than strB .P:System.String.Length.-or- indexA , indexB , or length is negative. -or-Either indexA or indexB is null , and length is greater than zero. |
|
static |
Compares substrings of two specified T:System.String 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 strA . |
strB | The second string to use in the comparison. |
indexB | The position of the substring within strB . |
length | The maximum number of characters in the substrings to compare. |
ignoreCase | true to ignore case during the comparison; otherwise, false . |
culture | An object that supplies culture-specific comparison information. |
T:System.ArgumentOutOfRangeException | indexA is greater than strA .P:System.String.Length.-or- indexB is greater than strB .P:System.String.Length.-or- indexA , indexB , or length is negative. -or-Either strA or strB is null , and length is greater than zero. |
T:System.ArgumentNullException | culture is null . |
|
static |
Compares substrings of two specified T:System.String objects using the specified comparison options and culture-specific information to influence the comparison, and returns an integer that indicates the relationship of the two substrings to each other in the sort order.
strA | The first string to use in the comparison. |
indexA | The starting position of the substring within strA . |
strB | The second string to use in the comparison. |
indexB | The starting position of the substring within strB . |
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). |
T:System.ArgumentException | options is not a T:System.Globalization.CompareOptions value. |
T:System.ArgumentOutOfRangeException | indexA is greater than strA .Length .-or- indexB is greater than strB .Length .-or- indexA , indexB , or length is negative.-or-Either strA or strB is null , and length is greater than zero. |
T:System.ArgumentNullException | culture is null . |
|
static |
Compares substrings of two specified T:System.String 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 strA . |
strB | The second string to use in the comparison. |
indexB | The position of the substring within strB . |
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. |
T:System.ArgumentOutOfRangeException | indexA is greater than strA .P:System.String.Length.-or- indexB is greater than strB .P:System.String.Length.-or- indexA , indexB , or length is negative. -or-Either indexA or indexB is null , and length is greater than zero. |
T:System.ArgumentException | comparisonType is not a T:System.StringComparison value. |
|
static |
Compares two specified T:System.String objects by evaluating the numeric values of the corresponding T:System.Char objects in each string.
strA | The first string to compare. |
strB | The second string to compare. |
|
static |
Compares substrings of two specified T:System.String objects by evaluating the numeric values of the corresponding T:System.Char objects in each substring.
strA | The first string to use in the comparison. |
indexA | The starting index of the substring in strA . |
strB | The second string to use in the comparison. |
indexB | The starting index of the substring in strB . |
length | The maximum number of characters in the substrings to compare. |
T:System.ArgumentOutOfRangeException | strA is not null and indexA is greater than strA .P:System.String.Length.-or- strB is not null andindexB is greater than strB .P:System.String.Length.-or- indexA , indexB , or length is negative. |
int System.String.CompareTo | ( | object | value | ) |
Compares this instance with a specified T:System.Object and indicates whether this instance precedes, follows, or appears in the same position in the sort order as the specified T:System.Object.
value | An object that evaluates to a T:System.String. |
null
. T:System.ArgumentException | value is not a T:System.String. |
int System.String.CompareTo | ( | string | strB | ) |
Compares this instance with a specified T:System.String 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. |
null
.
|
static |
|
static |
|
static |
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. |
|
static |
Concatenates the string representations of the elements in a specified T:System.Object array.
args | An object array that contains the elements to concatenate. |
T:System.ArgumentNullException | args is null . |
T:System.OutOfMemoryException | Out of memory. |
|
static |
Concatenates the members of a constructed T:System.Collections.Generic.IEnumerable`1 collection of type T:System.String.
values | A collection object that implements T:System.Collections.Generic.IEnumerable`1 and whose generic type argument is T:System.String. |
IEnumerable(Of String)
.T:System.ArgumentNullException | values is null . |
|
static |
|
static |
|
static |
Concatenates four specified instances of T:System.String.
str0 | The first string to concatenate. |
str1 | The second string to concatenate. |
str2 | The third string to concatenate. |
str3 | The fourth string to concatenate. |
|
static |
|
static |
Concatenates the members of an T:System.Collections.Generic.IEnumerable`1 implementation.
values | A collection object that implements the T:System.Collections.Generic.IEnumerable`1 interface. |
T | The type of the members of values . |
T:System.ArgumentNullException | values is null . |
bool System.String.Contains | ( | string | value | ) |
Returns a value indicating whether a specified substring occurs within this string.
value | The string to seek. |
true
if the value parameter occurs within this string, or if value is the empty string (""); otherwise, false
.T:System.ArgumentNullException | value is null . |
|
static |
unsafe void System.String.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 destination at which the copy operation begins. |
count | The number of characters in this instance to copy to destination . |
T:System.ArgumentNullException | destination is null . |
T:System.ArgumentOutOfRangeException | sourceIndex , destinationIndex , or count is negative -or- sourceIndex does not identify a position in the current instance. -or- destinationIndex does not identify a valid index in the destination array. -or- count is greater than the length of the substring from startIndex to the end of this instance -or- count is greater than the length of the subarray from destinationIndex to the end of the destination array. |
bool System.String.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. |
true
if value matches the end of this instance; otherwise, false
.T:System.ArgumentNullException | value is null . |
bool System.String.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 value are compared. |
true
if the value parameter matches the end of this string; otherwise, false
.T:System.ArgumentNullException | value is null . |
T:System.ArgumentException | comparisonType is not a T:System.StringComparison value. |
bool System.String.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 | true to ignore case during the comparison; otherwise, false . |
culture | Cultural information that determines how this instance and value are compared. If culture is null , the current culture is used. |
true
if the value parameter matches the end of this string; otherwise, false
.T:System.ArgumentNullException | value is null . |
override bool System.String.Equals | ( | object | obj | ) |
Determines whether this instance and a specified object, which must also be a T:System.String object, have the same value.
obj | The string to compare to this instance. |
true
if obj is a T:System.String and its value is the same as this instance; otherwise, false
. If obj is null
, the method returns false
.bool System.String.Equals | ( | string | value | ) |
Determines whether this instance and another specified T:System.String object have the same value.
value | The string to compare to this instance. |
true
if the value of the value parameter is the same as the value of this instance; otherwise, false
. If value is null
, the method returns false
. bool System.String.Equals | ( | string | value, |
StringComparison | comparisonType | ||
) |
Determines whether this string and a specified T:System.String 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. |
true
if the value of the value parameter is the same as this string; otherwise, false
.T:System.ArgumentException | comparisonType is not a T:System.StringComparison value. |
|
static |
Determines whether two specified T:System.String objects have the same value.
a | The first string to compare, or null . |
b | The second string to compare, or null . |
true
if the value of a is the same as the value of b ; otherwise, false
. If both a and b are null
, the method returns true
.
|
static |
Determines whether two specified T:System.String 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 null . |
b | The second string to compare, or null . |
comparisonType | One of the enumeration values that specifies the rules for the comparison. |
true
if the value of the a parameter is equal to the value of the b parameter; otherwise, false
.T:System.ArgumentException | comparisonType is not a T:System.StringComparison value. |
|
static |
Replaces one or more format items in a specified string with the string representation of a specified object.
format | A composite format string. |
arg0 | The object to format. |
T:System.ArgumentNullException | format is null . |
T:System.FormatException | The format item in format is invalid.-or- The index of a format item is not zero. |
|
static |
Replaces the format items in a specified 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. |
T:System.ArgumentNullException | format is null . |
T:System.FormatException | format is invalid.-or- The index of a format item is not zero or one. |
|
static |
Replaces the format items in a specified 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. |
T:System.ArgumentNullException | format is null . |
T:System.FormatException | format is invalid.-or- The index of a format item is less than zero, or greater than two. |
|
static |
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. |
T:System.ArgumentNullException | format or args is null . |
T:System.FormatException | format is invalid.-or- The index of a format item is less than zero, or greater than or equal to the length of the args array. |
|
static |
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. |
T:System.ArgumentNullException | format or arg0 is null . |
T:System.FormatException | format is invalid.-or- The index of a format item is less than zero, or greater than or equal to one. |
|
static |
Replaces the format items in a specified 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. |
T:System.ArgumentNullException | format , arg0 , or arg1 is null . |
T:System.FormatException | format is invalid.-or- The index of a format item is less than zero, or greater than or equal to two. |
|
static |
Replaces the format items in a specified 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. |
T:System.ArgumentNullException | format , arg0 , arg1 , or arg2 is null . |
T:System.FormatException | format is invalid.-or- The index of a format item is less than zero, or greater than or equal to three. |
|
static |
Replaces the format items in a specified 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. |
T:System.ArgumentNullException | format or args is null . |
T:System.FormatException | format is invalid.-or- The index of a format item is less than zero, or greater than or equal to the length of the args array. |
CharEnumerator System.String.GetEnumerator | ( | ) |
Retrieves an object that can iterate through the individual characters in this string.
Implements System.Collections.IEnumerable.
unsafe override int System.String.GetHashCode | ( | ) |
TypeCode System.String.GetTypeCode | ( | ) |
Returns the T:System.TypeCode for class T:System.String.
Implements System.IConvertible.
int System.String.IndexOf | ( | char | value | ) |
int System.String.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. |
T:System.ArgumentOutOfRangeException | startIndex is less than 0 (zero) or greater than the length of the string. |
int System.String.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. |
T:System.ArgumentOutOfRangeException | count or startIndex is negative.-or- startIndex is greater than the length of this string.-or- count is greater than the length of this string minus startIndex . |
int System.String.IndexOf | ( | string | value | ) |
Reports the zero-based index of the first occurrence of the specified string in this instance.
value | The string to seek. |
T:System.ArgumentNullException | value is null . |
int System.String.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. |
T:System.ArgumentNullException | value is null . |
T:System.ArgumentOutOfRangeException | startIndex is less than 0 (zero) or greater than the length of this string. |
int System.String.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. |
T:System.ArgumentNullException | value is null . |
T:System.ArgumentOutOfRangeException | count or startIndex is negative.-or- startIndex is greater than the length of this string.-or- count is greater than the length of this string minus startIndex . |
int System.String.IndexOf | ( | string | value, |
StringComparison | comparisonType | ||
) |
Reports the zero-based index of the first occurrence of the specified string in the current T:System.String 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. |
T:System.ArgumentNullException | value is null . |
T:System.ArgumentException | comparisonType is not a valid T:System.StringComparison value. |
int System.String.IndexOf | ( | string | value, |
int | startIndex, | ||
StringComparison | comparisonType | ||
) |
Reports the zero-based index of the first occurrence of the specified string in the current T:System.String 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. |
T:System.ArgumentNullException | value is null . |
T:System.ArgumentOutOfRangeException | startIndex is less than 0 (zero) or greater than the length of this string. |
T:System.ArgumentException | comparisonType is not a valid T:System.StringComparison value. |
int System.String.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 T:System.String object. Parameters specify the starting search position in the current string, the number of characters in the current string to search, and the type of search to use for the specified string.
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. |
T:System.ArgumentNullException | value is null . |
T:System.ArgumentOutOfRangeException | count or startIndex is negative.-or- startIndex is greater than the length of this instance.-or- count is greater than the length of this string minus startIndex . |
T:System.ArgumentException | comparisonType is not a valid T:System.StringComparison value. |
int System.String.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. |
T:System.ArgumentNullException | anyOf is null . |
int System.String.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. |
T:System.ArgumentNullException | anyOf is null . |
T:System.ArgumentOutOfRangeException | startIndex is negative.-or- startIndex is greater than the number of characters in this instance. |
int System.String.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. |
T:System.ArgumentNullException | anyOf is null . |
T:System.ArgumentOutOfRangeException | count or startIndex is negative.-or- count + startIndex is greater than the number of characters in this instance. |
unsafe string System.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. |
T:System.ArgumentNullException | value is null . |
T:System.ArgumentOutOfRangeException | startIndex is negative or greater than the length of this instance. |
|
static |
Retrieves the system's reference to the specified T:System.String.
str | A string to search for in the intern pool. |
T:System.ArgumentNullException | str is null . |
|
static |
Retrieves a reference to a specified T:System.String.
str | The string to search for in the intern pool. |
null
.T:System.ArgumentNullException | str is null . |
bool System.String.IsNormalized | ( | ) |
bool System.String.IsNormalized | ( | NormalizationForm | normalizationForm | ) |
Indicates whether this string is in the specified Unicode normalization form.
normalizationForm | A Unicode normalization form. |
true
if this string is in the normalization form specified by the normalizationForm parameter; otherwise, false
.T:System.ArgumentException | The current instance contains invalid Unicode characters. |
|
static |
|
static |
Indicates whether a specified string is null
, empty, or consists only of white-space characters.
value | The string to test. |
true
if the value parameter is null
or F:System.String.Empty, or if value consists exclusively of white-space characters.
|
static |
Concatenates all the elements of a string array, using the specified separator between each element.
separator | The string to use as a separator. separator is included in the returned string only if value has more than one element. |
value | An array that contains the elements to concatenate. |
T:System.ArgumentNullException | value is null . |
|
static |
Concatenates the elements of an object array, using the specified separator between each element.
separator | The string to use as a separator. separator is included in the returned string only if values has more than one element. |
values | An array that contains the elements to concatenate. |
T:System.ArgumentNullException | values is null . |
|
static |
Concatenates the members of a constructed T:System.Collections.Generic.IEnumerable`1 collection of type T:System.String, using the specified separator between each member.
separator | The string to use as a separator.separator is included in the returned string only if values has more than one element. |
values | A collection that contains the strings to concatenate. |
T:System.ArgumentNullException | values is null . |
|
static |
Concatenates the specified elements of a string array, using the specified separator between each element.
separator | The string to use as a separator. separator is included in the returned string only if value has more than one element. |
value | An array that contains the elements to concatenate. |
startIndex | The first element in value to use. |
count | The number of elements of value to use. |
T:System.ArgumentNullException | value is null . |
T:System.ArgumentOutOfRangeException | startIndex or count is less than 0.-or- startIndex plus count is greater than the number of elements in value . |
T:System.OutOfMemoryException | Out of memory. |
|
static |
Concatenates the members of a collection, using the specified separator between each member.
separator | The string to use as a separator.separator is included in the returned string only if values has more than one element. |
values | A collection that contains the objects to concatenate. |
T | The type of the members of values . |
T:System.ArgumentNullException | values is null . |
int System.String.LastIndexOf | ( | char | value | ) |
int System.String.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 startIndex toward the beginning of this instance. |
T:System.ArgumentOutOfRangeException | The current instance does not equal F:System.String.Empty, and startIndex is less than zero or greater than or equal to the length of this instance. |
int System.String.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 startIndex toward the beginning of this instance. |
count | The number of character positions to examine. |
T:System.ArgumentOutOfRangeException | The current instance does not equal F:System.String.Empty, and startIndex is less than zero or greater than or equal to the length of this instance.-or- The current instance does not equal F:System.String.Empty, and startIndex - count + 1 is less than zero. |
int System.String.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. |
T:System.ArgumentNullException | value is null . |
int System.String.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 startIndex toward the beginning of this instance. |
T:System.ArgumentNullException | value is null . |
T:System.ArgumentOutOfRangeException | The current instance does not equal F:System.String.Empty, and startIndex is less than zero or greater than the length of the current instance. -or-The current instance equals F:System.String.Empty, and startIndex is less than -1 or greater than zero. |
int System.String.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 startIndex toward the beginning of this instance. |
count | The number of character positions to examine. |
T:System.ArgumentNullException | value is null . |
T:System.ArgumentOutOfRangeException | count is negative.-or- The current instance does not equal F:System.String.Empty, and startIndex is negative.-or- The current instance does not equal F:System.String.Empty, and startIndex is greater than the length of this instance.-or- The current instance does not equal F:System.String.Empty, and startIndex - count + 1 specifies a position that is not within this instance. -or-The current instance equals F:System.String.Empty and start is less than -1 or greater than zero. -or-The current instance equals F:System.String.Empty and count is greater than 1. |
int System.String.LastIndexOf | ( | string | value, |
StringComparison | comparisonType | ||
) |
Reports the zero-based index of the last occurrence of a specified string within the current T:System.String 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. |
T:System.ArgumentNullException | value is null . |
T:System.ArgumentException | comparisonType is not a valid T:System.StringComparison value. |
int System.String.LastIndexOf | ( | string | value, |
int | startIndex, | ||
StringComparison | comparisonType | ||
) |
Reports the zero-based index of the last occurrence of a specified string within the current T:System.String 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 startIndex toward the beginning of this instance. |
comparisonType | One of the enumeration values that specifies the rules for the search. |
T:System.ArgumentNullException | value is null . |
T:System.ArgumentOutOfRangeException | The current instance does not equal F:System.String.Empty, and startIndex is less than zero or greater than the length of the current instance. -or-The current instance equals F:System.String.Empty, and startIndex is less than -1 or greater than zero. |
T:System.ArgumentException | comparisonType is not a valid T:System.StringComparison value. |
int System.String.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 startIndex 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. |
T:System.ArgumentNullException | value is null . |
T:System.ArgumentOutOfRangeException | count is negative.-or- The current instance does not equal F:System.String.Empty, and startIndex is negative.-or- The current instance does not equal F:System.String.Empty, and startIndex is greater than the length of this instance.-or- The current instance does not equal F:System.String.Empty, and startIndex + 1 - count specifies a position that is not within this instance. -or-The current instance equals F:System.String.Empty and start is less than -1 or greater than zero. -or-The current instance equals F:System.String.Empty and count is greater than 1. |
T:System.ArgumentException | comparisonType is not a valid T:System.StringComparison value. |
int System.String.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. |
T:System.ArgumentNullException | anyOf is null . |
int System.String.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 startIndex toward the beginning of this instance. |
T:System.ArgumentNullException | anyOf is null . |
T:System.ArgumentOutOfRangeException | The current instance does not equal F:System.String.Empty, and startIndex specifies a position that is not within this instance. |
int System.String.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 startIndex toward the beginning of this instance. |
count | The number of character positions to examine. |
T:System.ArgumentNullException | anyOf is null . |
T:System.ArgumentOutOfRangeException | The current instance does not equal F:System.String.Empty, and count or startIndex is negative.-or- The current instance does not equal F:System.String.Empty, and startIndex minus count + 1 is less than zero. |
string System.String.Normalize | ( | ) |
Returns a new string whose textual value is the same as this string, but whose binary representation is in Unicode normalization form C.
T:System.ArgumentException | The current instance contains invalid Unicode characters. |
string System.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. |
T:System.ArgumentException | The current instance contains invalid Unicode characters. |
|
static |
|
static |
string System.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. |
T:System.ArgumentOutOfRangeException | totalWidth is less than zero. |
string System.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. |
T:System.ArgumentOutOfRangeException | totalWidth is less than zero. |
string System.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. |
T:System.ArgumentOutOfRangeException | totalWidth is less than zero. |
string System.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. |
T:System.ArgumentOutOfRangeException | totalWidth is less than zero. |
unsafe string System.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. |
T:System.ArgumentOutOfRangeException | Either startIndex or count is less than zero.-or- startIndex plus count specify a position outside this instance. |
string System.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. |
T:System.ArgumentOutOfRangeException | startIndex is less than zero.-or- startIndex specifies a position that is not within this string. |
string System.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 oldChar . |
string System.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 oldValue . |
T:System.ArgumentNullException | oldValue is null . |
T:System.ArgumentException | oldValue is the empty string (""). |
string [] System.String.Split | ( | params 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 null . |
string [] System.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 null . |
count | The maximum number of substrings to return. |
T:System.ArgumentOutOfRangeException | count is negative. |
string [] System.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 null . |
options | F:System.StringSplitOptions.RemoveEmptyEntries to omit empty array elements from the array returned; or F:System.StringSplitOptions.None to include empty array elements in the array returned. |
T:System.ArgumentException | options is not one of the T:System.StringSplitOptions values. |
string [] System.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 null . |
count | The maximum number of substrings to return. |
options | F:System.StringSplitOptions.RemoveEmptyEntries to omit empty array elements from the array returned; or F:System.StringSplitOptions.None to include empty array elements in the array returned. |
T:System.ArgumentOutOfRangeException | count is negative. |
T:System.ArgumentException | options is not one of the T:System.StringSplitOptions values. |
string [] System.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 null . |
options | F:System.StringSplitOptions.RemoveEmptyEntries to omit empty array elements from the array returned; or F:System.StringSplitOptions.None to include empty array elements in the array returned. |
T:System.ArgumentException | options is not one of the T:System.StringSplitOptions values. |
string [] System.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 null . |
count | The maximum number of substrings to return. |
options | F:System.StringSplitOptions.RemoveEmptyEntries to omit empty array elements from the array returned; or F:System.StringSplitOptions.None to include empty array elements in the array returned. |
T:System.ArgumentOutOfRangeException | count is negative. |
T:System.ArgumentException | options is not one of the T:System.StringSplitOptions values. |
bool System.String.StartsWith | ( | string | value | ) |
Determines whether the beginning of this string instance matches the specified string.
value | The string to compare. |
true
if value matches the beginning of this string; otherwise, false
.T:System.ArgumentNullException | value is null . |
bool System.String.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 value are compared. |
true
if this instance begins with value ; otherwise, false
.T:System.ArgumentNullException | value is null . |
T:System.ArgumentException | comparisonType is not a T:System.StringComparison value. |
bool System.String.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 | true to ignore case during the comparison; otherwise, false . |
culture | Cultural information that determines how this string and value are compared. If culture is null , the current culture is used. |
true
if the value parameter matches the beginning of this string; otherwise, false
.T:System.ArgumentNullException | value is null . |
string System.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. |
T:System.ArgumentOutOfRangeException | startIndex is less than zero or greater than the length of this instance. |
string System.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. |
T:System.ArgumentOutOfRangeException | startIndex plus length indicates a position not within this instance.-or- startIndex or length is less than zero. |
unsafe char [] System.String.ToCharArray | ( | ) |
unsafe char [] System.String.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. |
T:System.ArgumentOutOfRangeException | startIndex or length is less than zero.-or- startIndex plus length is greater than the length of this instance. |
string System.String.ToLower | ( | ) |
string System.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. |
T:System.ArgumentNullException | culture is null . |
string System.String.ToLowerInvariant | ( | ) |
override string System.String.ToString | ( | ) |
string System.String.ToString | ( | IFormatProvider | provider | ) |
Returns this instance of T:System.String; no actual conversion is performed.
provider | (Reserved) An object that supplies culture-specific formatting information. |
Implements System.IConvertible.
string System.String.ToUpper | ( | ) |
string System.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. |
T:System.ArgumentNullException | culture is null . |
string System.String.ToUpperInvariant | ( | ) |
string System.String.Trim | ( | params char [] | trimChars | ) |
Removes all leading and trailing occurrences of a set of characters specified in an array from the current T:System.String object.
trimChars | An array of Unicode characters to remove, or null . |
null
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.string System.String.Trim | ( | ) |
Removes all leading and trailing white-space characters from the current T:System.String object.
string System.String.TrimEnd | ( | params char [] | trimChars | ) |
Removes all trailing occurrences of a set of characters specified in an array from the current T:System.String object.
trimChars | An array of Unicode characters to remove, or null . |
null
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. string System.String.TrimStart | ( | params char [] | trimChars | ) |
Removes all leading occurrences of a set of characters specified in an array from the current T:System.String object.
trimChars | An array of Unicode characters to remove, or null . |
null
or an empty array, white-space characters are removed instead.
|
static |
|
get |
|
get |
Gets the T:System.Char object at a specified position in the current T:System.String object.
index | A position in the current string. |
T:System.IndexOutOfRangeException | index is greater than or equal to the length of this object or less than zero. |