BCL mscorlib [00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00 ] 1.0.5000.0 2.0.0.0 4.0.0.0 This type is safe for multithreaded operations. System.Object System.Collections.Generic.IEnumerable<System.Char> System.ICloneable System.IComparable System.IComparable<System.String> System.IConvertible System.IEquatable<System.String> System.Runtime.InteropServices.ComVisible(true)

Example 1

The following example demonstrates formatting numeric data types and inserting literal curly brackets into strings.

`using System; class StringFormatTest { public static void Main() { decimal dec = 1.99999m; double doub = 1.0000000001; string somenums = String.Format("Some formatted numbers: dec={0,15:E} doub={1,20}", dec, doub); Console.WriteLine(somenums); string curlies = "Literal curly brackets: {{ and }} and {{0}}"; Console.WriteLine(curlies); object nullObject = null; string embeddedNull = String.Format("A null argument looks like: {0}", nullObject); Console.WriteLine(embeddedNull); } }`

The output is

`Some formatted numbers: dec= 1.999990E+000 doub= 1.0000000001 Literal curly brackets: {{ and }} and {{0}} A null argument looks like:`

Example 2

The following example demonstrates how formatting works if is or is not implemented by an argument to the method. Note that the format specifier is ignored if the argument does not implement .

`using System; class StringFormatTest { public class DefaultFormatEleven { public override string ToString() { return "11 string"; } } public class FormattableEleven:IFormattable { // The IFormattable ToString implementation. public string ToString(string format, IFormatProvider formatProvider) { Console.Write("[IFormattable called] "); return 11.ToString(format, formatProvider); } // Override Object.ToString to show that it is not called. public override string ToString() { return "Formatted 11 string"; } } public static void Main() { DefaultFormatEleven def11 = new DefaultFormatEleven (); FormattableEleven for11 = new FormattableEleven(); string def11string = String.Format("{0}",def11); Console.WriteLine(def11string); // The format specifier x is ignored. def11string = String.Format("{0,15:x}", def11); Console.WriteLine(def11string); string form11string = String.Format("{0}",for11); Console.WriteLine(form11string ); form11string = String.Format("{0,15:x}",for11); Console.WriteLine(form11string); } }`

The output is

`11 string 11 string [IFormattable called] 11 [IFormattable called] b`

Example 3

The following example demonstrates searching for an empty string in a non-empty string.

`using System; class EmptyStringSearch { public static void Main() { Console.WriteLine("ABCDEF".IndexOf("")); Console.WriteLine("ABCDEF".IndexOf("", 2)); Console.WriteLine("ABCDEF".IndexOf("", 3, 2)); Console.WriteLine("ABCDEF".LastIndexOf("")); Console.WriteLine("ABCDEF".LastIndexOf("", 1)); Console.WriteLine("ABCDEF".LastIndexOf("", 4, 2)); } }`

The output is

`0 2 3 5 1 4`

A string is a sequential collection of Unicode characters that is used to represent text. A object is a sequential collection of objects that represent a string. The value of the object is the content of the sequential collection, and that value is immutable (that is, it is read-only). For more information about the immutability of strings, see the Immutability and the StringBuilder class section later in this topic. The maximum size of a object in memory is 2 GB, or about 1 billion characters.

In this section:

Instantiating a String object
Char objects and Unicode characters
Strings and embedded null characters
Strings and indexes
Null strings and empty strings
Immutability and the StringBuilder class
Ordinal vs. culture-sensitive operations
Normalization
String operations by category

## Instantiating a String object

You can instantiate a object in the following ways:

By assigning a string literal to a variable. This is the most commonly used method for creating a string. The following example uses assignment to create several strings. Note that in C#, because the backslash (\) is an escape character, literal backslashes in a string must be escaped or the entire string must be @-quoted.

code reference: System.String.Class.Instantiate#1

By calling a class constructor. The following example instantiates strings by calling several class constructors. Note that some of the constructors include pointers to character arrays or signed byte arrays as parameters. Visual Basic does not support calls to these constructors. For detailed information about constructors, see the constructor summary.

code reference: System.String.Class.Instantiate#2

By using the string concatenation operator (+ in C# and & or + in Visual Basic) to create a single string from any combination of instances and string literals. The following example illustrates the use of the string concatenation operator.

code reference: System.String.Class.Instantiate#3

By retrieving a property or calling a method that returns a string. The following example uses the methods of the class to extract a substring from a larger string.

code reference: System.String.Class.Instantiate#4

By calling a formatting method to convert a value or object to its string representation. The following example uses the composite formatting feature to embed the string representation of two objects into a string.

code reference: System.String.Class.Instantiate#5

## Char objects and Unicode characters

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

A single object usually represents a single code point; that is, the numeric value of the equals the code point. For example, the code point for the character "a" is U+0061. However, a code point might require more than one encoded element (more than one object). The Unicode standard defines three types of characters that correspond to multiple objects: graphemes, Unicode supplementary code points, and characters in the supplementary planes.

A grapheme is represented by a base character followed by one or more combining characters. For example, the character ä is represented by a object whose code point is U+0061 followed by a object whose code point is U+0308. This character can also be defined by a single object that has a code point of U+00E4. As the following example shows, a culture-sensitive comparison for equality indicates that these two representations are equal, although an ordinary ordinal comparison does not. However, if the two strings are normalized, an ordinal comparison also indicates that they are equal. (For more information on normalizing strings, see the Normalization section.)

code reference: System.String.Class#2

A Unicode supplementary code point (a surrogate pair) is represented by a object whose code point is a high surrogate followed by a object whose code point is a low surrogate. The code units of high surrogates range from U+D800 to U+DBFF. The code units of low surrogates range from U+DC00 to U+DFFF. Surrogate pairs are used to represent characters in the 16 Unicode supplementary planes. The following example creates a surrogate character and passes it to the method to determine whether it is a surrogate pair.

code reference: System.String.Class#3

## Strings and embedded null characters

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

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

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

You should ensure that native C and C++ code that instantiates objects, and code that is passed objects through platform invoke, do not assume that an embedded null character marks the end of the string.

Embedded null characters in a string are also treated differently when a string is sorted (or compared) and when a string is searched. Null characters are ignored when performing culture-sensitive comparisons between two strings, including comparisons using the invariant culture. They are considered only for ordinal or case-insensitive ordinal comparisons. On the other hand, embedded null characters are always considered when searching a string with methods such as , , and .

## Strings and indexes

An index is the position of a object (not a Unicode character) in a . An index is a zero-based, nonnegative number that starts from the first position in the string, which is index position zero. A number of search methods, such as and , return the index of a character or substring in the string instance.

The property lets you access individual objects by their index position in the string. Because the property is the default property (in Visual Basic) or the indexer (in C#), you can access the individual objects in a string by using code such as the following. This code looks for white space or punctuation characters in a string to determine how many words the string contains.

code reference: System.String.Class#4

Because the class implements the interface, you can also iterate through the objects in a string by using a foreach construct, as the following example shows.

code reference: System.String.Class#5

Consecutive index values might not correspond to consecutive Unicode characters, because a Unicode character might be encoded as more than one object. In particular, a string may contain multi-character units of text that are formed by a base character followed by one or more combining characters or by surrogate pairs. To work with Unicode characters instead of objects, use the and classes. The following example illustrates the difference between code that works with objects and code that works with Unicode characters. It compares the number of characters or text elements in each word of a sentence. The string includes two sequences of a base character followed by a combining character.

code reference: System.String.Class#6

This example works with text elements by using the method and the class to enumerate all the text elements in a string. You can also retrieve an array that contains the starting index of each text element by calling the method.

For more information about working with units of text rather than individual values, see the class.

## Null strings and empty strings

A string that has been declared but has not been assigned a value is null. Attempting to call methods on that string throws a . A null string is different from an empty string, which is a string whose value is "" or . In some cases, passing either a null string or an empty string as an argument in a method call throws an exception. For example, passing a null string to the method throws an , and passing an empty string throws a . In other cases, a method argument can be either a null string or an empty string. For example, if you are providing an implementation for a class, you want to equate both a null string and an empty string with the general ("G") format specifier.

The class includes the following two convenience methods that enable you to test whether a string is null or empty:

, which indicates whether a string is either null or is equal to . This method eliminates the need to use code such as the following:

code reference: System.String.Class.Null#1

, which indicates whether a string is null, equals , or consists exclusively of white-space characters. This method eliminates the need to use code such as the following:

code reference: System.String.Class.Null#2

The following example uses the method in the implementation of a custom Temperature class. The method supports the "G", "C", "F", and "K" format strings. If an empty format string or a format string whose value is null is passed to the method, its value is changed to the "G" format string.

code reference: System.String.Class.Null#3

## Immutability and the StringBuilder class

A object is called immutable (read-only), because its value cannot be modified after it has been created. Methods that appear to modify a object actually return a new object that contains the modification.

Because strings are immutable, string manipulation routines that perform repeated additions or deletions to what appears to be a single string can exact a significant performance penalty. For example, the following code uses a random number generator to create a string with 1000 characters in the range 0x0001 to 0x052F. Although the code appears to use string concatenation to append a new character to the existing string named str, it actually creates a new object for each concatenation operation.

code reference: System.String.Class#15

You can use the class instead of the class for operations that make multiple changes to the value of a string. Unlike instances of the class, objects are mutable; when you concatenate, append, or delete substrings from a string, the operations are performed on a single string. When you have finished modifying the value of a object, you can call its method to convert it to a string. The following example replaces the used in the previous example to concatenate 1000 random characters in the range to 0x0001 to 0x052F with a object.

code reference: System.String.Class#16

## Ordinal vs. culture-sensitive operations

Members of the class perform either ordinal or culture-sensitive (linguistic) operations on a object. An ordinal operation acts on the numeric value of each object. A culture-sensitive operation acts on the value of the object, and takes culture-specific casing, sorting, formatting, and parsing rules into account. Culture-sensitive operations execute in the context of an explicitly declared culture or the implicit current culture. The two kinds of operations can produce very different results when they are performed on the same string.

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

Most methods that perform string operations include an overload that has a parameter of type , which enables you to specify whether the method performs an ordinal or culture-sensitive operation. In general, you should call this overload to make the intent of your method call clear. For best practices and guidance for using ordinal and culture-sensitive operations on strings, see Best Practices for Using Strings in the .NET Framework.

Operations for casing, parsing and formatting, comparison and sorting, and testing for equality can be either ordinal or culture-sensitive. The following sections discuss each category of operation.

## Casing

Casing rules determine how to change the capitalization of a Unicode character; for example, from lowercase to uppercase. Often, a casing operation is performed before a string comparison. For example, a string might be converted to uppercase so that it can be compared with another uppercase string. You can convert the characters in a string to lowercase by calling the or method, and you can convert them to uppercase by calling the or method. In addition, you can use the method to convert a string to title case.

Casing operations can be based on the rules of the current culture, a specified culture, or the invariant culture. Because case mappings can vary depending on the culture used, the result of casing operations can vary based on culture. The actual differences in casing are of three kinds:

Differences in the case mapping of LATIN CAPITAL LETTER I (U+0049), LATIN SMALL LETTER I (U+0069), LATIN CAPITAL LETTER I WITH DOT ABOVE (U+0130), and LATIN SMALL LETTER DOTLESS I (U+0131). In the tr-TR (Turkish (Turkey)) and az-Latn-AZ (Azerbaijan, Latin) cultures, and in the tr, az, and az-Latn neutral cultures, the lowercase equivalent of LATIN CAPITAL LETTER I is LATIN SMALL LETTER DOTLESS I, and the uppercase equivalent of LATIN SMALL LETTER I is LATIN CAPITAL LETTER I WITH DOT ABOVE. In all other cultures, including the invariant culture, LATIN SMALL LETTER I and LATIN CAPITAL LETTER I are lowercase and uppercase equivalents.

The following example demonstrates how a string comparison designed to prevent file system access can fail if it relies on a culture-sensitive casing comparison. (The casing conventions of the invariant culture should have been used.)

code reference: System.String.Class#17

Differences in case mappings between the invariant culture and all other cultures. In these cases, using the casing rules of the invariant culture to change a character to uppercase or lowercase returns the same character. For all other cultures, it returns a different character. Some of the affected characters are listed in the following table.

Character

If changed to

Returns

MICRON SIGN (U+00B5)

Uppercase

GREEK CAPITAL LETTER MU (U+-39C)

LATIN CAPITAL LETTER I WITH DOT ABOVE (U+0130)

Lowercase

LATIN SMALL LETTER I (U+0069)

LATIN SMALL LETTER DOTLESS I (U+0131)

Uppercase

LATIN CAPITAL LETTER I (U+0049)

LATIN SMALL LETTER LONG S (U+017F)

Uppercase

LATIN CAPITAL LETTER S (U+0053)

LATIN CAPITAL LETTER D WITH SMALL LETTER Z WITH CARON (U+01C5)

Lowercase

LATIN SMALL LETTER DZ WITH CARON (U+01C6)

COMBINING GREEK YPOGEGRAMMENI (U+0345)

Uppercase

GREEK CAPITAL LETTER IOTA (U+0399)

Differences in case mappings of two-letter mixed-case pairs in the ASCII character range. In most cultures, a two-letter mixed-case pair is equal to the equivalent two-letter uppercase or lowercase pair. This is not true for the following two-letter pairs in the following cultures, because in each case they are compared to a digraph:

"lJ" and "nJ" in the hr-HR (Croatian (Croatia)) culture.

"cH" in the cs-CZ (Czech (Czech Republic)) and sk-SK (Slovak (Slovakia)) cultures.

"aA" in the da-DK (Danish (Denmark)) culture.

"cS", "dZ", "dZS", "nY", "sZ", "tY", and "zS" in the hu-HU (Hungarian (Hungary)) culture.

"cH" and "lL" in the es-ES_tradnl (Spanish (Spain, Traditional Sort)) culture.

"cH", "gI", "kH", "nG" "nH", "pH", "qU', "tH", and "tR" in the vi-VN (Vietnamese (Vietnam)) culture.

However, it is unusual to encounter a situation in which a culture-sensitive comparison of these pairs creates problems, because these pairs are uncommon in fixed strings or identifiers.

The following example illustrates some of the differences in casing rules between cultures when converting strings to uppercase.

code reference: System.String.Class#7

## Parsing and formatting

Formatting and parsing are inverse operations. Formatting rules determine how to convert a value, such as a date and time or a number, to its string representation, whereas parsing rules determine how to convert a string representation to a value such as a date and time. Both formatting and parsing rules are dependent on cultural conventions. The following example illustrates the ambiguity that can arise when interpreting a culture-specific date string. Without knowing the conventions of the culture that was used to produce a date string, it is not possible to know whether 03/01/2011, 3/1/2011, and 01/03/2011 represent January 3, 2011 or March 1, 2011.

code reference: System.String.Class#8

Similarly, as the following example shows, a single string can produce different dates depending on the culture whose conventions are used in the parsing operation.

code reference: System.String.Class#9

## String comparison and sorting

Sort rules determine the alphabetic order of Unicode characters and how two strings compare to each other. For example, the method compares two strings based on the parameter. If the parameter value is , the method performs a linguistic comparison that uses the conventions of the current culture; if the parameter value is , the method performs an ordinal comparison. Consequently, as the following example shows, if the current culture is U.S. English, the first call to the method (using culture-sensitive comparison) considers "a" less than "A", but the second call to the same method (using ordinal comparison) considers "a" greater than "A".

code reference: System.String.Class#10

The .NET Framework supports word, string, and ordinal sort rules:

A word sort performs a culture-sensitive comparison of strings in which certain nonalphanumeric Unicode characters might have special weights assigned to them. For example, the hyphen (-) might have a very small weight assigned to it so that "coop" and "co-op" appear next to each other in a sorted list. For a list of the methods that compare two strings using word sort rules, see the String operations by category section.

A string sort also performs a culture-sensitive comparison. It is similar to a word sort, except that there are no special cases, and all nonalphanumeric symbols come before all alphanumeric Unicode characters. Two strings can be compared using string sort rules by calling the method overloads that have an parameter that is supplied a value of . Note that this is the only method that the .NET Framework provides to compare two strings using string sort rules.

An ordinal sort compares strings based on the numeric value of each object in the string. An ordinal comparison is automatically case-sensitive because the lowercase and uppercase versions of a character have different code points. However, if case is not important, you can specify an ordinal comparison that ignores case. This is equivalent to converting the string to uppercase by using the invariant culture and then performing an ordinal comparison on the result. For a list of the methods that compare two strings using ordinal sort rules, see the String operations by category section.

A culture-sensitive comparison is any comparison that explicitly or implicitly uses a object, including the invariant culture that is specified by the property. The implicit culture is the current culture, which is specified by the and properties. There is considerable variation in the sort order of alphabetic characters (that is, characters for which the property returns true) across cultures. You can specify a culture-sensitive comparison that uses the conventions of a specific culture by supplying a object to a string comparison method such as . You can specify a culture-sensitive comparison that uses the conventions of the current culture by supplying , , or any member of the enumeration other than or to an appropriate overload of the method. A culture-sensitive comparison is generally appropriate for sorting whereas an ordinal comparison is not. An ordinal comparison is generally appropriate for determining whether two strings are equal (that is, for determining identity) whereas a culture-sensitive comparison is not.

Use the following general guidelines to choose an appropriate sorting or string comparison method:

If you want the strings to be ordered based on the user's culture, you should order them based on the conventions of the current culture. If the user's culture changes, the order of sorted strings will also change accordingly. For example, a thesaurus application should always sort words based on the user's culture.

If you want the strings to be ordered based on the conventions of a specific culture, you should order them by supplying a object that represents that culture to a comparison method. For example, in an application designed to teach students a particular language, you want strings to be ordered based on the conventions of one of the cultures that speaks that language.

If you want the order of strings to remain unchanged across cultures, you should order them based on the conventions of the invariant culture or use an ordinal comparison. For example, you would use an ordinal sort to organize the names of files, processes, mutexes, or named pipes.

For a comparison that involves a security decision (such as whether a user name is valid), you should always perform an ordinal test for equality by calling an overload of the method.

The culture-sensitive sorting and casing rules used in string comparison depend on the version of the .NET Framework. In the net_v45 running on the win8 operating system, sorting, casing, normalization, and Unicode character information conforms to the Unicode 6.0 standard. On other operating systems, it conforms to the Unicode 5.0 standard.

For more information about word, string, and ordinal sort rules, see the topic. For additional recommendations on when to use each rule, see Best Practices for Using Strings in the .NET Framework.

Ordinarily, you do not call string comparison methods such as directly to determine the sort order of strings. Instead, comparison methods are called by sorting methods such as or . The following example performs four different sorting operations (word sort using the current culture, word sort using the invariant culture, ordinal sort, and string sort using the invariant culture) without explicitly calling a string comparison method. Note that each type of sort produces a unique ordering of strings in its array.

code reference: System.String.Class#12

If your primary purpose in comparing strings is to determine whether they are equal, you should call the method. Typically, you should use to perform an ordinal comparison. The method is intended primarily to sort strings.

String search methods, such as and , also can perform culture-sensitive or ordinal string comparisons. The following example illustrates the differences between ordinal and culture-sensitive comparisons using the method. A culture-sensitive search in which the current culture is English (United States) considers the substring "oe" to match the ligature "œ". Because a soft hyphen (U+00AD) is a zero-width character, the search treats the soft hyphen as equivalent to and finds a match at the beginning of the string. An ordinal search, on the other hand, does not find a match in either case.

code reference: System.String.Class#13

## Testing for equality

Use the method to determine the relationship of two strings in the sort order. Typically, this is a culture-sensitive operation. In contrast, call the method to test for equality. Because the test for equality usually compares user input with some known string, such as a valid user name, a password, or a file system path, it is typically an ordinal operation.

It is possible to test for equality by calling the method and determining whether the return value is zero. However, this practice is not recommended. To determine whether two strings are equal, you should call one of the overloads of the method. The preferred overload to call is either the instance method or the static method, because both methods include a parameter that explicitly specifies the type of comparison.

The following example illustrates the danger of performing a culture-sensitive comparison for equality when an ordinal one should be used instead. In this case, the intent of the code is to prohibit file system access from URLs that begin with "FILE://" or "file://" by performing a case-insensitive comparison of the beginning of a URL with the string "FILE://". However, if a culture-sensitive comparison is performed using the Turkish (Turkey) culture on a URL that begins with "file://", the comparison for equality fails, because the Turkish uppercase equivalent of the lowercase "i" is "İ" instead of "I". As a result, file system access is inadvertently permitted. On the other hand, if an ordinal comparison is performed, the comparison for equality succeeds, and file system access is denied.

code reference: System.String.Class#11

## Normalization

Some Unicode characters have multiple representations. For example, any of the following code points can represent the letter "ắ":

U+1EAF

U+0103 U+0301

U+0061 U+0306 U+0301

Multiple representations for a single character complicate searching, sorting, matching, and other string operations.

The Unicode standard defines a process called normalization that returns one binary representation of a Unicode character for any of its equivalent binary representations. Normalization can use several algorithms, called normalization forms, that follow different rules. The .NET Framework supports Unicode normalization forms C, D, KC, and KD. When strings have been normalized to the same normalization form, they can be compared by using ordinal comparison.

An ordinal comparison is a binary comparison of the Unicode scalar value of corresponding objects in each string. The class includes a number of methods that can perform an ordinal comparison, including the following:

Any overload of the , , , , , and methods that includes a parameter. The method performs an ordinal comparison if you supply a value of or for this parameter.

The overloads of the method.

Methods that use ordinal comparison by default, such as , , and .

Methods that search for a value or for the elements in a array in a string instance. Such methods include and .

You can determine whether a string is normalized to normalization form C by calling the method, or you can call the method to determine whether a string is normalized to a specified normalization form. You can also call the method to convert a string to normalization form C, or you can call the method to convert a string to a specified normalization form. For step-by-step information about normalizing and comparing strings, see the and methods.

The following simple example illustrates string normalization. It defines the letter "ố" in three different ways in three different strings, and uses an ordinal comparison for equality to determine that each string differs from the other two strings. It then converts each string to the supported normalization forms, and again performs an ordinal comparison of each string in a specified normalization form. In each case, the second test for equality shows that the strings are equal.

code reference: System.String.Class#14

For more information about normalization and normalization forms, see , as well as Unicode Standard Annex #15: Unicode Normalization Forms and the Normalization FAQ on the unicode.org website.

## String operations by category

The class provides members for comparing strings, testing strings for equality, finding characters or substrings in a string, modifying a string, extracting substrings from a string, combining strings, formatting values, copying a string, and normalizing a string.

## Comparing strings

You can compare strings to determine their relative position in the sort order by using the following methods:

returns an integer that indicates the relationship of one string to a second string in the sort order.

returns an integer that indicates the relationship of one string to a second string based on a comparison of their code points.

returns an integer that indicates the relationship of the current string instance to a second string in the sort order. The method provides the and implementations for the class.

## Testing strings for equality

You call the method to determine whether two strings are equal. The instance and the static overloads let you specify whether the comparison is culture-sensitive or ordinal, and whether case is considered or ignored. Most tests for equality are ordinal, and comparisons for equality that determine access to a system resource (such as a file system object) should always be ordinal.

## Finding characters in a string

The class includes two kinds of search methods:

Methods that return a value to indicate whether a particular substring is present in a string instance. These include the , , and methods.

Methods that indicate the starting position of a substring in a string instance. These include the , , , and methods.

If you want to search a string for a particular pattern rather than a specific substring, you should use regular expressions. For more information, see .NET Framework Regular Expressions.

## Modifying a string

The class includes the following methods that appear to modify the value of a string:

inserts a string into the current instance.

inserts one or more occurrences of a specified character at the beginning of a string.

inserts one or more occurrences of a specified character at the beginning of a string.

deletes a substring from the current instance.

replaces a substring with another substring in the current instance.

and convert all the characters in a string to lowercase.

and convert all the characters in a string to uppercase.

removes all occurrences of a character from the beginning and end of a string.

removes all occurrences of a character from the end of a string.

removes all occurrences of a character from the beginning of a string.

All string modification methods return a new object. They do not modify the value of the current instance.

## Extracting substrings from a string

The method separates a single string into multiple strings. Overloads of the method allow you to specify multiple delimiters, to determine the maximum number of substrings that the method extracts, and to determine whether empty strings (which occur when delimiters are adjacent) are included among the returned strings.

## Combining strings

The following methods can be used for string concatenation:

combines one or more substrings into a single string.

concatenates one or more substrings into a single element and adds a separator between each substring.

## Formatting values

The method uses the composite formatting feature to replace one or more placeholders in a string with the string representation of some object or value. The method is often used to do the following:

To embed the string representation of a numeric value in a string.

To embed the string representation of a date and time value in a string.

To embed the string representation of an enumeration value in a string.

To embed the string representation of some object that supports the interface in a string.

To right-justify or left-justify a substring in a field within a larger string.

For detailed information about formatting operations and examples, see the overload summary.

## Copying a string

You can call the following methods to make a copy of a string:

returns a reference to an existing object.

creates a copy of an existing string.

copies a portion of a string to a character array.

## Normalizing a string

In Unicode, a single character can have multiple code points. Normalization converts these equivalent characters into the same binary representation. The method performs the normalization, and the method determines whether a string is normalized.

Represents text as a series of Unicode characters.

- Constructor
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)

  For examples and comprehensive usage information about this and other String constructor overloads, see the constructor summary.

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

  A pointer to a null-terminated array of Unicode characters.
  0
- Constructor
  1.0.5000.0
  2.0.0.0
  4.0.0.0

  For examples and comprehensive usage information about this and other String constructor overloads, see the constructor summary.

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

  An array of Unicode characters.
  0
- Constructor
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)

  For examples and comprehensive usage information about this and other String constructor overloads, see the constructor summary.

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

  A pointer to a null-terminated array of 8-bit signed integers.
- Constructor
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  is less than zero.

  The following example demonstrates using this constructor.

  using System;

  public class StringExample { public static void Main() {

  string s = new String('a', 10);

  Console.WriteLine(s); } }

  The output is

  aaaaaaaaaa

  The number of times occurs.

  For examples and comprehensive usage information about this and other String constructor overloads, see the constructor summary.

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

  A Unicode character.
  The number of times occurs.
  0
- Constructor
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)

  or is less than zero.

  -or-

  is a null pointer and is not zero.

  For examples and comprehensive usage information about this and other String constructor overloads, see the constructor summary.

  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.

  A pointer to an array of Unicode characters.
  The starting position within .
  The number of characters within to use.
  0
- Constructor
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  is a null reference.

  or is less than zero.

  -or-

  The sum of and is greater than the number of elements in .

  For examples and comprehensive usage information about this and other String constructor overloads, see the constructor summary.

  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.

  An array of Unicode characters.
  The starting position within .
  The number of characters within to use.
  0
- Constructor
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)

  For examples and comprehensive usage information about this and other String constructor overloads, see the constructor summary.

  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.

  A pointer to an array of 8-bit signed integers.
  The starting position within .
  The number of characters within to use.
- Constructor
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)

  or is less than zero.

  -or-

  is a null pointer and is not zero.

  An object that specifies how the array referenced by is encoded. If is null, ANSI encoding is assumed.

  For examples and comprehensive usage information about this and other String constructor overloads, see the constructor summary.

  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.

  A pointer to an array of 8-bit signed integers.
  The starting position within .
  The number of characters within to use.
  An object that specifies how the array referenced by is encoded. If is null, ANSI encoding is assumed.
  1
  RuntimeInfrastructure
- Property
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Char `` To be added.

  Gets the character at a specified position in the current instance.

  A Unicode character at the location index in the current instance.

  This property is read-only.

  is the position of a character within a string. The first character in the string is at index 0. The length of a string is the number of characters it is made up of. The last accessible of a string instance is its length - 1.

  is greater than or equal to the length of the current instance or less than zero. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Object

  The return value is not an independent copy of this instance; it is simply another view of the same data. Use the or method to create a separate object with the same value as this instance.

  Because the method simply returns the existing string instance, there is little reason to call it directly.

  Returns a reference to this instance of .

  This instance of .

  0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 `` ``

  The comparison uses the current culture to obtain culture-specific information such as casing rules and the alphabetic order of individual characters. For example, a culture could specify that certain combinations of characters be treated as a single character, or uppercase and lowercase characters be compared in a particular way, or that the sorting order of a character depends on the characters that precede or follow it.

  The comparison is performed using word sort rules. For more information about word, string, and ordinal sorts, see .

  When comparing strings, you should call the method, which requires that you explicitly specify the type of string comparison that the method uses. For more information, see Best Practices for Using Strings in the .NET Framework.

  One or both comparands can be null. By definition, any string, including the empty string (""), compares greater than a null reference; and two null references compare equal to each other.

  The comparison terminates when an inequality is discovered or both strings have been compared. However, if the two strings compare equal to the end of one string, and the other string has characters remaining, then the string with remaining characters is considered greater. The return value is the result of the last comparison performed.

  Unexpected results can occur when comparisons are affected by culture-specific casing rules. For example, in Turkish, the following example yields the wrong results because the file system in Turkish does not use linguistic casing rules for the letter "i" in "file".

  code reference: System.String.Compare#10

  Compare the path name to "file" using an ordinal comparison. The correct code to do this is as follows:

  code reference: System.String.Compare#11

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

  A 32-bit signed integer that indicates the lexical relationship between the two comparands.

  Value

  Condition

  Less than zero

  is less than .

  Zero

  equals .

  Greater than zero

  is greater than .

  The first string to compare. The second string to compare. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 `` `` ``

  The following example demonstrates comparing strings with and without case sensitivity.

  `using System; public class StringCompareExample { public static void Main() { string strA = "A STRING"; string strB = "a string"; int first = String.Compare( strA, strB, true ); int second = String.Compare( strA, strB, false ); Console.WriteLine( "When 'A STRING' is compared to 'a string' in a case-insensitive manner, the return value is {0}.", first ); Console.WriteLine( "When 'A STRING' is compared to 'a string' in a case-sensitive manner, the return value is {0}.", second ); } }`

  The output is

  When 'A STRING' is compared to 'a string' in a case-insensitive manner, the return value is 0.

  When 'A STRING' is compared to 'a string' in a case-sensitive manner, the return value is 1.

  The comparison uses the current culture to obtain culture-specific information such as casing rules and the alphabetic order of individual characters. For example, a culture could specify that certain combinations of characters be treated as a single character, or uppercase and lowercase characters be compared in a particular way, or that the sorting order of a character depends on the characters that precede or follow it.

  The comparison is performed using word sort rules. For more information about word, string, and ordinal sorts, see .

  When comparing strings, you should call the method, which requires that you explicitly specify the type of string comparison that the method uses. For more information, see Best Practices for Using Strings in the .NET Framework.

  One or both comparands can be null. By definition, any string, including the empty string (""), compares greater than a null reference; and two null references compare equal to each other.

  The comparison terminates when an inequality is discovered or both strings have been compared. However, if the two strings compare equal to the end of one string, and the other string has characters remaining, then the string with remaining characters is considered greater. The return value is the result of the last comparison performed.

  Unexpected results can occur when comparisons are affected by culture-specific casing rules. For example, in Turkish, the following example yields the wrong results because the file system in Turkish does not use linguistic casing rules for the letter "i" in "file".

  code reference: System.String.Compare#12

  Compare the path name to "file" using an ordinal comparison. The correct code to do this is as follows:

  code reference: System.String.Compare#13

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

  A 32-bit signed integer that indicates the lexical relationship between the two comparands.

  Value

  Condition

  Less than zero

  is less than .

  Zero

  equals .

  Greater than zero

  is greater than .

  The first string to compare. The second string to compare. true to ignore case during the comparison; otherwise, false. 0
- Method
  2.0.0.0
  4.0.0.0
  System.Int32 `` `` ``

  The parameter indicates whether the comparison should use the current or invariant culture, honor or ignore the case of the comparands, or use word (culture-sensitive) or ordinal (culture-insensitive) sort rules.

  One or both comparands can be null. By definition, any string, including the empty string (""), compares greater than a null reference; and two null references compare equal to each other.

  The comparison terminates when an inequality is discovered or both strings have been compared. However, if the two strings compare equal to the end of one string, and the other string has characters remaining, the string with remaining characters is considered greater. The return value is the result of the last comparison performed.

  Unexpected results can occur when comparisons are affected by culture-specific casing rules. For example, in Turkish, the following example yields the wrong results because the file system in Turkish does not use linguistic casing rules for the letter "i" in "file".

  code reference: System.String.Compare#16

  Compare the path name to "file" using an ordinal comparison. The correct code to do this is as follows:

  code reference: System.String.Compare#17

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

  A 32-bit signed integer that indicates the lexical relationship between the two comparands.

  Value

  Condition

  Less than zero

  is less than .

  Zero

  equals .

  Greater than zero

  is greater than .

  The first string to compare. The second string to compare. One of the enumeration values that specifies the rules to use in the comparison.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 `` `` `` ``

  The comparison uses the parameter to obtain culture-specific information such as casing rules and the alphabetic order of individual characters. For example, a culture could specify that certain combinations of characters be treated as a single character, or uppercase and lowercase characters be compared in a particular way, or that the sorting order of a character depends on the characters that precede or follow it.

  The comparison is performed using word sort rules. For more information about word, string, and ordinal sorts, see .

  One or both comparands can be null. By definition, any string, including the empty string (""), compares greater than a null reference; and two null references compare equal to each other.

  The comparison terminates when an inequality is discovered or both strings have been compared. However, if the two strings compare equal to the end of one string, and the other string has characters remaining, then the string with remaining characters is considered greater. The return value is the result of the last comparison performed.

  Unexpected results can occur when comparisons are affected by culture-specific casing rules. For example, in Turkish, the following example yields the wrong results because the file system in Turkish does not use linguistic casing rules for the letter "i" in "file".

  code reference: System.String.Compare#14

  Compare the path name to "file" using an ordinal comparison. The correct code to do this is as follows:

  code reference: System.String.Compare#15

  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.

  A 32-bit signed integer that indicates the lexical relationship between the two comparands.

  Value

  Condition

  Less than zero

  is less than .

  Zero

  equals .

  Greater than zero

  is greater than .

  The first string to compare. The second string to compare. true to ignore case during the comparison; otherwise, false. An object that supplies culture-specific comparison information.
- Method
  2.0.0.0
  4.0.0.0
  System.Int32 `` `` `` ``

  The comparison uses the parameter to obtain culture-specific information, such as casing rules and the alphabetical order of individual characters. For example, a particular culture could specify that certain combinations of characters be treated as a single character, that uppercase and lowercase characters be compared in a particular way, or that the sort order of a character depends on the characters that precede or follow it.

  The method is designed primarily for use in sorting or alphabetizing operations. It should not be used when the primary purpose of the method call is to determine whether two strings are equivalent (that is, when the purpose of the method call is to test for a return value of zero). To determine whether two strings are equivalent, call the method.

  The comparison can be further specified by the parameter, which consists of one or more members of the enumeration. However, because the purpose of this method is to conduct a culture-sensitive string comparison, the and values have no effect.

  Either or both comparands can be null. By definition, any string, including , compares greater than a null reference, and two null references compare equal to each other.

  The comparison terminates when an inequality is discovered or both strings have been compared. However, if the two strings compare equal to the end of one string, and the other string has characters remaining, the string with the remaining characters is considered greater.

  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.

  A 32-bit signed integer that indicates the lexical relationship between and , as shown in the following table

  Value

  Condition

  Less than zero

  is less than .

  Zero

  equals .

  Greater than zero

  is greater than .

  The first string to compare. The second string to compare. The culture that supplies culture-specific comparison information. Options to use when performing the comparison (such as ignoring case or symbols).
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 `` `` `` `` ``

  The sum of and is greater than .Length .

  -or-

  The sum of and is greater than .Length .

  -or-

  , , or is negative.

  The following example demonstrates comparing substrings.

  `using System; public class StringCompareExample { public static void Main() { string strA = "A string"; string strB = "B ring"; int first = String.Compare( strA, 4, strB, 2, 3 ); int second = String.Compare( strA, 3, strB, 3, 3 ); Console.WriteLine( "When the substring 'rin' of 'A string' is compared to the substring 'rin' of 'B ring', the return value is {0}.", first ); Console.WriteLine( "When the substring 'tri' of 'A string' is compared to the substring 'ing' of 'B ring', the return value is {0}.", second ); } }`

  The output is

  When the substring 'rin' of 'A string' is compared to the substring 'rin' of 'B ring', the return value is 0.

  When the substring 'tri' of 'A string' is compared to the substring 'ing' of 'B ring', the return value is 1.

  The substrings to compare start in at and in at . Both and are zero-based; that is, the first character in and is at position zero. The length of the first substring is equal to the length of minus plus one. The length of the second substring is equal to the length of minus plus one.

  The number of characters to compare is the lesser of the lengths of the two substrings, and . The , , and parameters must be nonnegative.

  The comparison uses the current culture to obtain culture-specific information such as casing rules and the alphabetic order of individual characters. For example, a culture could specify that certain combinations of characters be treated as a single character, or uppercase and lowercase characters be compared in a particular way, or that the sorting order of a character depends on the characters that precede or follow it.

  The comparison is performed using word sort rules. For more information about word, string, and ordinal sorts, see .

  When comparing strings, you should call the method, which requires that you explicitly specify the type of string comparison that the method uses. For more information, see Best Practices for Using Strings in the .NET Framework.

  One or both comparands can be null. By definition, any string, including the empty string (""), compares greater than a null reference; and two null references compare equal to each other.

  The comparison terminates when an inequality is discovered or both substrings have been compared. However, if the two strings compare equal to the end of one string, and the other string has characters remaining, then the string with remaining characters is considered greater. The return value is the result of the last comparison performed.

  Unexpected results can occur when comparisons are affected by culture-specific casing rules. For example, in Turkish, the following example yields the wrong results because the file system in Turkish does not use linguistic casing rules for the letter "i" in "file".

  code reference: System.String.Compare#2

  Compare the path name to "file" using an ordinal comparison. The correct code to do this is as follows:

  code reference: System.String.Compare#3

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

  A 32-bit signed integer indicating 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 .

  The first string to use in the comparison. The position of the substring within . The second string to use in the comparison. The position of the substring within . The maximum number of characters in the substrings to compare. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 `` `` `` `` `` ``

  is greater than .Length

  -or-

  is greater than .Length

  -or-

  , , or is negative.

  The following example demonstrates comparing substrings with and without case sensitivity.

  `using System; public class StringCompareExample { public static void Main() { string strA = "STRING A"; string strB = "string b"; int first = String.Compare( strA, strB, true ); int second = String.Compare( strA, 0, strB, 0, 4, true ); int third = String.Compare( strA, 0, strB, 0, 4, false ); Console.WriteLine( "When the string 'STRING A' is compared to the string 'string b' in a case-insensitive manner, the return value is {0}.", first ); Console.WriteLine( "When the substring 'STRI' of 'STRING A' is compared to the substring 'stri' of 'string b' in a case-insensitive manner, the return value is {0}.", second ); Console.WriteLine( "When the substring 'STRI' of 'STRING A' is compared to the substring 'stri' of 'string b' in a case-sensitive manner, the return value is {0}.", third ); } }`

  The output is

  When the string 'STRING A' is compared to the string 'string b' in a case-insensitive manner, the return value is -1.

  When the substring 'STRI' of 'STRING A' is compared to the substring 'stri' of 'string b' in a case-insensitive manner, the return value is 0.

  When the substring 'STRI' of 'STRING A' is compared to the substring 'stri' of 'string b' in a case-sensitive manner, the return value is 1.

  true to ignore case during the comparison; otherwise, false.

  The substrings to compare start in at , and in at . Both and are zero-based; that is, the first character in and is at position zero. The length of the first substring is equal to the length of minus plus one. The length of the second substring is equal to the length of minus plus one.

  The number of characters to compare is the lesser of the lengths of the two substrings, and . The , , and parameters must be nonnegative.

  The comparison uses the current culture to obtain culture-specific information such as casing rules and the alphabetic order of individual characters. For example, a culture could specify that certain combinations of characters be treated as a single character, or uppercase and lowercase characters be compared in a particular way, or that the sorting order of a character depends on the characters that precede or follow it.

  The comparison is performed using word sort rules. For more information about word, string, and ordinal sorts, see .

  When comparing strings, you should call the method, which requires that you explicitly specify the type of string comparison that the method uses. For more information, see Best Practices for Using Strings in the .NET Framework.

  One or both comparands can be null. By definition, any string, including the empty string (""), compares greater than a null reference; and two null references compare equal to each other.

  The comparison terminates when an inequality is discovered or both substrings have been compared. However, if the two strings compare equal to the end of one string, and the other string has characters remaining, then the string with remaining characters is considered greater. The return value is the result of the last comparison performed.

  Unexpected results can occur when comparisons are affected by culture-specific casing rules. For example, in Turkish, the following example yields the wrong results because the file system in Turkish does not use linguistic casing rules for the letter "i" in "file".

  code reference: System.String.Compare#4

  The path name needs to be compared in an invariant manner. The correct code to do this is as follows.

  code reference: System.String.Compare#5

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

  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 .

  The first string to use in the comparison. The position of the substring within . The second string to use in the comparison. The position of the substring within . The maximum number of characters in the substrings to compare. true to ignore case during the comparison; otherwise, false. 0
- Method
  2.0.0.0
  4.0.0.0
  System.Int32 `` `` `` `` `` ``

  The substrings to compare start in at and in at . Both and are zero-based; that is, the first character in and is at position zero, not position one. The length of the first substring is equal to the length of minus plus one. The length of the second substring is equal to the length of minus plus one.

  The number of characters to compare is the lesser of the lengths of the two substrings, and . The , , and parameters must be nonnegative.

  The parameter indicates whether the comparison should use the current or invariant culture, honor or ignore the case of the comparands, or use word (culture-sensitive) or ordinal (culture-insensitive) sort rules.

  One or both comparands can be null. By definition, any string, including the empty string (""), compares greater than a null reference; and two null references compare equal to each other.

  The comparison terminates when an inequality is discovered or both substrings have been compared. However, if the two strings compare equal to the end of one string, and the other string has characters remaining, the string with remaining characters is considered greater. The return value is the result of the last comparison performed.

  Unexpected results can occur when comparisons are affected by culture-specific casing rules. For example, in Turkish, the following example yields the wrong results because the file system in Turkish does not use linguistic casing rules for the letter "i" in "file".

  code reference: System.String.Compare#8

  Compare the path name to "file" using an ordinal comparison. The correct code to do this is as follows:

  code reference: System.String.Compare#9

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

  A 32-bit signed integer that indicates the lexical relationship between the two comparands.

  Value

  Condition

  Less than zero

  The substring in the parameter is less than the substring in the parameter.

  Zero

  The substrings are equal, or the parameter is zero.

  Greater than zero

  The substring in is greater than the substring in .

  The first string to use in the comparison. The position of the substring within . The second string to use in the comparison. The position of the substring within . The maximum number of characters in the substrings to compare. One of the enumeration values that specifies the rules to use in the comparison.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 `` `` `` `` `` `` ``

  The substrings to compare start in at , and in at . Both and are zero-based; that is, the first character in and is at position zero, not position one. The length of the first substring is equal to the length of minus plus one. The length of the second substring is equal to the length of minus plus one.

  The number of characters to compare is the lesser of the lengths of the two substrings, and . The , , and parameters must be nonnegative.

  The comparison uses the parameter to obtain culture-specific information such as casing rules and the alphabetic order of individual characters. For example, a culture could specify that certain combinations of characters be treated as a single character, or uppercase and lowercase characters be compared in a particular way, or that the sorting order of a character depends on the characters that precede or follow it.

  The comparison is performed using word sort rules. For more information about word, string, and ordinal sorts, see .

  One or both comparands can be null. By definition, any string, including the empty string (""), compares greater than a null reference; and two null references compare equal to each other.

  The comparison terminates when an inequality is discovered or both substrings have been compared. However, if the two strings compare equal to the end of one string, and the other string has characters remaining, then the string with remaining characters is considered greater. The return value is the result of the last comparison performed.

  Unexpected results can occur when comparisons are affected by culture-specific casing rules. For example, in Turkish, the following example yields the wrong results because the file system in Turkish does not use linguistic casing rules for the letter "i" in "file".

  code reference: System.String.Compare#6

  Compare the path name to "file" using an ordinal comparison. The correct code to do this is as follows:

  code reference: System.String.Compare#7

  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.

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

  The first string to use in the comparison. The position of the substring within . The second string to use in the comparison. The position of the substring within . The maximum number of characters in the substrings to compare. true to ignore case during the comparison; otherwise, false. An object that supplies culture-specific comparison information.
- Method
  2.0.0.0
  4.0.0.0
  System.Int32 `` `` `` `` `` `` ``

  The substrings to compare start in at position and in at position . The length of the first substring is the length of minus . The length of the second substring is the length of minus .

  The number of characters to compare is the lesser of the lengths of the two substrings, and . The , , and parameters must be nonnegative.

  The comparison uses the parameter to obtain culture-specific information, such as casing rules and the alphabetical order of individual characters. For example, a particular culture could specify that certain combinations of characters be treated as a single character, that uppercase and lowercase characters be compared in a particular way, or that the sort order of a character depends on the characters that precede or follow it.

  The method is designed primarily for use in sorting or alphabetizing operations. It should not be used when the primary purpose of the method call is to determine whether two substrings are equivalent (that is, when the purpose of the method call is to test for a return value of zero). To determine whether two strings are equivalent, call the method.

  One or both of and can be null. By definition, any string, including , compares greater than a null reference, and two null references compare equal to each other.

  The comparison can be further specified by the parameter, which consists of one or more members of the enumeration. However, because the purpose of this method is to conduct a culture-sensitive string comparison, the and values have no effect.

  The comparison terminates when an inequality is discovered or both substrings have been compared. However, if the two strings compare equal to the end of one string, and the other string has characters remaining, the string with the remaining characters is considered greater. The return value is the result of the last comparison performed.

  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.

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

  The first string to use in the comparison. The starting position of the substring within . The second string to use in the comparison. The starting position of the substring within . The maximum number of characters in the substrings to compare. An object that supplies culture-specific comparison information. Options to use when performing the comparison (such as ignoring case or symbols).
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 `` ``

  This method performs a case-sensitive comparison using ordinal sort rules. For more information about word, string, and ordinal sorts, see . To perform a case-insensitive comparison using ordinal sort rules, call the method with a value of .

  Because is a static method, and can be null. If both values are null, the method returns 0 (zero), which indicates that and are equal. If only one of the values is null, the method considers the non-null value to be greater.

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

  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 .

  The first string to compare. The second string to compare. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 `` `` `` `` ``

  is greater than .Length

  -or-

  is greater than .Length

  -or-

  , , or is negative.

  The , , and parameters must be nonnegative.

  The number of characters compared is the lesser of the length of less , the length of less , and .

  This method performs a case-sensitive comparison using ordinal sort rules. For more information about word, string, and ordinal sorts, see . To perform a case-insensitive comparison using ordinal sort rules, call the method with a value of .

  Because is a static method, and can be null. If both values are null, the method returns 0 (zero), which indicates that and are equal. If only one of the values is null, the method considers the non-null value to be greater.

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

  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 .

  The first string to use in the comparison. The starting index of the substring in . The second string to use in the comparison. The starting index of the substring in . The maximum number of characters in the substrings to compare. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 `` is not a .

  must be a object.

  The method was designed primarily for use in sorting or alphabetizing operations. It should not be used when the primary purpose of the method call is to determine whether two strings are equivalent. To determine whether two strings are equivalent, call the method.

  This method performs a word (case-sensitive and culture-sensitive) comparison using the current culture. For more information about word, string, and ordinal sorts, see .

  For more information about the behavior of this method, see the Remarks section of the method.

  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 .

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

  An object that evaluates to a . 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 ``

  This method performs a word (case-sensitive and culture-sensitive) comparison using the current culture. For more information about word, string, and ordinal sorts, see .

  The method was designed primarily for use in sorting or alphabetizing operations. It should not be used when the primary purpose of the method call is to determine whether two strings are equivalent. To determine whether two strings are equivalent, call the method.

  For more information about the behavior of this method, see the Remarks section of the method.

  This method implements the interface and performs slightly better than the method, because it does not have to determine whether the argument is a mutable value type that must be boxed, and it does not have to cast its parameter from an to a .

  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 .

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

  The string to compare with this instance.
- Method
  4.0.0.0
  System.Runtime.InteropServices.ComVisible(false)
  System.String ``

  The method concatenates each object in ; it does not add any delimiters. To specify a delimiter between each member of , call the method.

  An string is used in place of any null argument.

  is a convenience method that lets you concatenate each element in an IEnumerable(Of String) collection without first converting the elements to a string array. It is particularly useful with Language-Integrated Query (LINQ) query expressions. The following example passes a List(Of String) object that contains either the uppercase or lowercase letters of the alphabet to a lambda expression that selects letters that are equal to or greater than a particular letter (which, in the example, is "M"). The IEnumerable(Of String) collection that is returned by the method is passed to the method to display the result as a single string.

  code reference: System.String.Concat#3

  Concatenates the members of a constructed collection of type .

  The concatenated strings in .

  A collection object that implements and whose generic type argument is .
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.String ``

  The method represents as a string by calling its parameterless ToString method.

  Creates the string representation of a specified object.

  The string representation of the value of , or if is null.

  The object to represent, or null.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.String `System.ParamArray` is a null reference.

  The following example demonstrates concatenating an array of objects.

  `using System; public class StringConcatExample { public static void Main() { string str = String.Concat( 'c', 32, "String" ); Console.WriteLine( "The concatenated Object array is: {0}", str ); } }`

  The output is

  The concatenated Object array is: c32String

  The method concatenates each object in by calling the parameterless ToString method of that object; it does not add any delimiters.

  is used in place of any null object in the array.

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

  The concatenated string representations of the values of the elements in .

  An object array that contains the elements to concatenate. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.String `System.ParamArray` is a null reference.

  The following example demonstrates concatenating an array of strings.

  `using System; public class StringConcatExample { public static void Main() { string str = String.Concat( "one", "two", "three", "four", "five" ); Console.WriteLine( "The concatenated String array is: {0}", str ); } }`

  The output is

  The concatenated String array is: onetwothreefourfive

  The method concatenates each object in ; it does not add any delimiters.

  An string is used in place of any null object in the array.

  Concatenates the elements of a specified array.

  The concatenated elements of .

  An array of string instances. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.String `` ``

  The following example demonstrates concatenating two objects.

  `using System; public class StringConcatExample { public static void Main() { string str = String.Concat( 'c', 32 ); Console.WriteLine( "The concatenated Objects are: {0}", str ); } }`

  The output is

  The concatenated Objects are: c32

  The method concatenates and by calling the parameterless ToString method of and ; it does not add any delimiters.

  is used in place of any null argument.

  If either of the arguments is an array reference, the method concatenates a string representing that array, instead of its members (for example, "System.String[]").

  Concatenates the string representations of two specified objects.

  The concatenated string representations of the values of and .

  The first object to concatenate. The second object to concatenate. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.String `` ``

  The following example demonstrates concatenating two strings.

  `using System; public class StringConcatExample { public static void Main() { string str = String.Concat( "one", "two" ); Console.WriteLine( "The concatenated strings are: {0}", str ); } }`

  The output is

  The concatenated strings are: onetwo

  The method concatenates and ; it does not add any delimiters.

  An string is used in place of any null argument.

  Concatenates two specified instances of .

  The concatenation of and .

  The first string to concatenate. The second string to concatenate. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.String `` `` ``

  The following example demonstrates concatenating three objects.

  `using System; public class StringConcatExample { public static void Main() { string str = String.Concat( 'c', 32, "String" ); Console.WriteLine( "The concatenated Objects are: {0}", str ); } }`

  The output is

  The concatenated Objects are: c32String

  The method concatenates , , and by calling the parameterless ToString method of each object; it does not add any delimiters.

  is used in place of any null argument.

  Concatenates the string representations of three specified objects.

  The concatenated string representations of the values of , , and .

  The first object to concatenate. The second object to concatenate. The third object to concatenate. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.String `` `` ``

  The following example demonstrates concatenating three strings.

  `using System; public class StringConcatExample { public static void Main() { string str = String.Concat( "one", "two", "three" ); Console.WriteLine( "The concatenated strings are: {0}", str ); } }`

  The output is

  The concatenated strings are: onetwothree

  The method concatenates , , and ; it does not add any delimiters.

  An string is used in place of any null argument.

  Concatenates three specified instances of .

  The concatenation of , , and .

  The first string to concatenate. The second string to concatenate. The third string to concatenate. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.String `` `` `` ``

  The method concatenates each object in the parameter list by calling its parameterless ToString method; it does not add any delimiters.

  is used in place of any null argument.

  The last parameter of the method is an optional comma-delimited list of one or more additional objects to concatenate.

  Concatenates the string representations of four specified objects and any objects specified in an optional variable length parameter list.

  The concatenated string representation of each value in the parameter list.

  The first object to concatenate. The second object to concatenate. The third object to concatenate. The fourth object to concatenate.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.String `` `` `` ``

  The method concatenates , , , and ; it does not add any delimiters.

  An string is used in place of any null object in the array.

  Concatenates four specified instances of .

  The concatenation of , , , and .

  The first string to concatenate. The second string to concatenate. The third string to concatenate. The fourth string to concatenate.
- Method
  4.0.0.0
  System.Runtime.InteropServices.ComVisible(false)
  System.String ``

  The method concatenates each object in ; it does not add any delimiters.

  An string is used in place of any null argument.

  is a convenience method that lets you concatenate each element in an collection without first converting the elements to strings. It is particularly useful with Language-Integrated Query (LINQ) query expressions, as the example illustrates. The string representation of each object in the collection is derived by calling that object's ToString method.

  Concatenates the members of an implementation.

  The concatenated members in .

  A collection object that implements the interface. The type of the members of .
- Method
  2.0.0.0
  4.0.0.0
  System.Boolean ``

  This method performs an ordinal (case-sensitive and culture-insensitive) comparison. The search begins at the first character position of this string and continues through the last character position.

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

  true if the parameter occurs within this string, or if is the empty string (""); otherwise, false.

  The string to seek.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.String `` is a null reference.

  The following example demonstrates copying strings.

  `using System; public class StringCopyExample { public static void Main() { string strA = "string"; Console.WriteLine( "The initial string, strA, is '{0}'.", strA ); string strB = String.Copy( strA ); strA = strA.ToUpper(); Console.WriteLine( "The copied string, strB, before strA.ToUpper, is '{0}'.", strB ); Console.WriteLine( "The initial string after StringCopy and ToUpper, is '{0}'.", strA ); Console.WriteLine( "The copied string, strB, after strA.ToUpper, is '{0}'.", strB ); } }`

  The output is

  The initial string, strA, is 'string'.

  The copied string, strB, before strA.ToUpper, is 'string'.

  The initial string after StringCopy and ToUpper, is 'STRING'.

  The copied string, strB, after strA.ToUpper, is 'string'.

  The method returns a object that has the same value as the original string but represents a different object reference. It differs from an assignment operation, which assigns an existing string reference to an additional object variable. The example illustrates the difference.

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

  A new string with the same value as .

  The string to copy. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Void `` `` `` `` is a null reference.

  , , or is negative

  -or-

  is greater than the length of the substring from to the end of the current instance

  -or-

  is greater than the length of the subarray from to the end of

  The following example demonstrates copying characters from a string to a Unicode character array.

  `using System; public class StringCopyToExample { public static void Main() { string str = "this is the new string"; Char[] cAry = {'t','h','e',' ','o','l','d'}; Console.WriteLine( "The initial string is '{0}'", str ); Console.Write( "The initial character array is: '" ); foreach( Char c in cAry) Console.Write( c ); Console.WriteLine( "'" ); str.CopyTo( 12, cAry, 4, 3 ); Console.Write( "The character array after CopyTo is: '" ); foreach( Char c in cAry) Console.Write( c ); Console.WriteLine("'"); } }`

  The output is

  The initial string is 'this is the new string'

  The initial character array is: 'the old'

  The character array after CopyTo is: 'the new'

  This method copies characters from the position of this instance to the position of character array. This method does not resize the character array; it must have a sufficient number of elements to accommodate the copied characters or the method throws an .

  and are zero-based.

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

  The index of the first character in this instance to copy. An array of Unicode characters to which characters in this instance are copied. The index in at which the copy operation begins. The number of characters in this instance to copy to . 0
- Field
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.String

  The value of this field is the zero-length string, "".

  In application code, this field is most commonly used in assignments to initialize a string variable to an empty string. To test whether the value of a string is either null or , use the method.

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

  0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Boolean `` is a null reference.

  The following example demonstrates determining whether the current instance ends with a specified string.

  `using System; public class StringEndsWithExample { public static void Main() { string str = "One string to compare"; Console.WriteLine( "The given string is '{0}'", str ); Console.Write( "The given string ends with 'compare'? " ); Console.WriteLine( str.EndsWith( "compare" ) ); Console.Write( "The given string ends with 'Compare'? " ); Console.WriteLine( str.EndsWith( "Compare" ) ); } }`

  The output is

  The given string is 'One string to compare'

  The given string ends with 'compare'? True

  The given string ends with 'Compare'? False

  This method compares to the substring at the end of this instance that is the same length as , and returns an indication whether they are equal. To be equal, must be a reference to this same instance or match the end of this instance.

  This method performs a word (case-sensitive and culture-sensitive) comparison using the current culture.

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

  true if matches the end of this instance; otherwise, false.

  The string to compare to the substring at the end of this instance. 0
- Method
  2.0.0.0
  4.0.0.0
  System.Runtime.InteropServices.ComVisible(false)
  System.Boolean `` ``

  The method compares the parameter to the substring at the end of this string and returns a value that indicates whether they are equal. To be equal, must be a reference to this same string, must be the empty string (""), or must match the end of this string. The type of comparison performed by the method depends on the value of the parameter.

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

  true if the parameter matches the end of this string; otherwise, false.

  The string to compare to the substring at the end of this instance. One of the enumeration values that determines how this string and are compared.
- Method
  2.0.0.0
  4.0.0.0
  System.Boolean `` `` ``

  This method compares the parameter to the substring at the end of this string that is the same length as , and returns a value that indicates whether they are equal. To be equal, must be a reference to this same instance or match the end of this string.

  This method performs a word (culture-sensitive) comparison using the specified casing and culture.

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

  true if the parameter matches the end of this string; otherwise, false.

  The string to compare to the substring at the end of this instance. true to ignore case during the comparison; otherwise, false. Cultural information that determines how this instance and are compared. If is null, the current culture is used.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.MayFail)
  System.Boolean `` The current instance is a null reference.

  The following example demonstrates checking to see if an object is equal to the current instance.

  `using System; public class StringEqualsExample { public static void Main() { string str = "A string"; Console.WriteLine( "The given string is '{0}'", str ); Console.Write( "The given string is equal to 'A string'? " ); Console.WriteLine( str.Equals( "A string" ) ); Console.Write( "The given string is equal to 'A String'? " ); Console.WriteLine( str.Equals( "A String" ) ); } }`

  The output is

  The given string is 'A string'

  The given string is equal to 'A string'? True

  The given string is equal to 'A String'? False

  This method performs an ordinal (case-sensitive and culture-insensitive) comparison.

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

  true if is a and its value is the same as this instance; otherwise, false.

  The string to compare to this instance. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.MayFail)
  System.Boolean ``

  This method performs an ordinal (case-sensitive and culture-insensitive) comparison.

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

  true if the value of the parameter is the same as this instance; otherwise, false.

  The string to compare to this instance.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Boolean `` ``

  The following example demonstrates checking to see if two strings are equal.

  `using System; public class StringEqualsExample { public static void Main() { string strA = "A string"; string strB = "a string"; string strC = "a string"; Console.Write( "The string '{0}' is equal to the string '{1}'? ", strA, strB ); Console.WriteLine( String.Equals( strA, strB ) ); Console.Write( "The string '{0}' is equal to the string '{1}'? ", strC, strB ); Console.WriteLine( String.Equals( strC, strB ) ); } }`

  The output is

  The string 'A string' is equal to the string 'a string'? False

  The string 'a string' is equal to the string 'a string'? True

  This method performs an ordinal (case-sensitive and culture-insensitive) comparison.

  Determines whether two specified objects have the same value.

  true if the value of is the same as the value of ; otherwise, false. If both and are null, the method returns true.

  The first string to compare, or null. The second string to compare, or null. 0
- Method
  2.0.0.0
  4.0.0.0
  System.Boolean `` ``

  The parameter indicates whether the comparison should use the current or invariant culture, honor or ignore the case of the two strings being compared, or use word or ordinal sort rules.

  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.

  true if the value of the parameter is the same as this string; otherwise, false.

  The string to compare to this instance. One of the enumeration values that specifies how the strings will be compared.
- Method
  2.0.0.0
  4.0.0.0
  System.Boolean `` `` ``

  The parameter indicates whether the comparison should use the current or invariant culture, honor or ignore the case of the two strings being compared, or use word or ordinal sort rules.

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

  true if the value of the parameter is equal to the value of the parameter; otherwise, false.

  The first string to compare, or null. The second string to compare, or null. One of the enumeration values that specifies the rules for the comparison.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.String `` `` is a null reference.

  The format specification in is invalid.

  -or-

  The number indicating an argument to be formatted is less than zero, or greater than or equal to the number of provided objects to be formatted (1).

  The following example demonstrates the method.

  `using System; public class StringFormat { public static void Main() { Console.WriteLine(String.Format("The high temperature today was {0:###} degrees.", 88)); Console.WriteLine("The museum had {0,-6} visitors today.", 88); } }`

  The output is

  `The high temperature today was 88 degrees. The museum had 88 visitors today.`

  For examples and comprehensive usage information about this and other overloads of the Format method, see the overload summary.

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

  A copy of in which any format items are replaced by the string representation of .

  A composite format string. The object to format. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.String `` `System.ParamArray` or is a null reference.

  is invalid.

  -or-

  The number indicating an argument to be formatted is less than zero, or greater than or equal to the length of the array.

  The following example demonstrates the method.

  `using System; public class StringFormat { public static void Main() { Console.WriteLine( String.Format("The winning numbers were {0:000} {1:000} {2:000} {3:000} {4:000} today.", 5, 10, 11, 37, 42) ); Console.WriteLine( "The winning numbers were {0, -6}{1, -6}{2, -6}{3, -6}{4, -6} today.", 5, 10, 11, 37, 42 ); } }`

  The output is

  `The winning numbers were 005 010 011 037 042 today. The winning numbers were 5 10 11 37 42 today.`

  For examples and comprehensive usage information about this and other overloads of the Format method, see the overload summary.

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

  A copy of in which the format items have been replaced by the string representation of the corresponding objects in .

  A composite format string. An object array that contains zero or more objects to format. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.String `` `` `System.ParamArray` or is a null reference.

  is invalid.

  -or-

  The number indicating an argument to be formatted () is less than zero, or greater than or equal to the length of the array.

  For examples and comprehensive usage information about this and other overloads of the Format method, see the overload summary.

  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.

  A copy of in which the format items have been replaced by the string representation of the corresponding objects in .

  An object that supplies culture-specific formatting information. A composite format string. An object array that contains zero or more objects to format. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.String `` `` `` is a null reference.

  is invalid.

  -or-

  The number indicating an argument to be formatted is less than zero, or greater than or equal to the number of provided objects to be formatted (2).

  The following example demonstrates the method.

  `using System; public class StringFormat { public static void Main() { Console.WriteLine( String.Format("The temperature today oscillated between {0:####} and {1:####} degrees.", 78, 100) ); Console.WriteLine( String.Format("The temperature today oscillated between {0:0000} and {1:0000} degrees.", 78, 100) ); Console.WriteLine( "The temperature today oscillated between {0, -4} and {1, -4} degrees.", 78, 100 ); } }`

  The output is

  `The temperature today oscillated between 78 and 100 degrees. The temperature today oscillated between 0078 and 0100 degrees. The temperature today oscillated between 78 and 100 degrees.`

  For examples and comprehensive usage information about this and other overloads of the Format method, see the overload summary.

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

  A copy of in which format items are replaced by the string representations of and .

  A composite format string. The first object to format. The second object to format. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.String `` `` `` `` is a null reference.

  is invalid.

  -or-

  The number indicating an argument to be formatted is less than zero, or greater than or equal to the number of provided objects to be formatted (3).

  The following example demonstrates the method.

  `using System; public class StringFormat { public static void Main() { Console.WriteLine(String.Format("The temperature today oscillated between {0:###} and {1:###} degrees. The average temperature was {2:000} degrees.", 78, 100, 91)); Console.WriteLine("The temperature today oscillated between {0, 4} and {1, 4} degrees. The average temperature was {2, 4} degrees.", 78, 100, 91); } }`

  The output is

  `The temperature today oscillated between 78 and 100 degrees. The average temperature was 091 degrees. The temperature today oscillated between 78 and 100 degrees. The average temperature was 91 degrees.`

  For examples and comprehensive usage information about this and other overloads of the Format method, see the overload summary.

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

  A copy of in which the format items have been replaced by the string representations of , , and .

  A composite format string. The first object to format. The second object to format. The third object to format. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CharEnumerator

  This method enables you to iterate the individual characters in a string. For example, the Visual Basic For Each and C# foreach statements invoke this method to return a object that can provide read-only access to the characters in this string instance.

  Retrieves an object that can iterate through the individual characters in this string.

  An enumerator object.

  0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.MayFail)
  System.Int32

  The behavior of is dependent on its implementation, which might change from one version of the common language runtime to another. A reason why this might happen is to improve the performance of .

  If two string objects are equal, the method returns identical values. However, there is not a unique hash code value for each unique string value. Different strings can return the same hash code.

  The hash code itself is not guaranteed to be stable. Hash codes for identical strings can differ across versions of the .NET Framework and across platforms (such as 32-bit and 64-bit) for a single version of the .NET Framework. In some cases, they can even differ by application domain.

  As a result, hash codes should never be used outside of the application domain in which they were created, they should never be used as key fields in a collection, and they should never be persisted.

  Finally, do not use the hash code instead of a value returned by a cryptographic hashing function if you need a cryptographically strong hash. For cryptographic hashes, use a class derived from the or class.

  For more information about hash codes, see .

  In desktop apps, you can use the <UseRandomizedStringHashAlgorithm> element to generate unique hash codes on a per application domain basis. This can reduce the number of collisions and improve the overall performance of insertions and lookups that use hash tables. The following example shows how to use the <UseRandomizedStringHashAlgorithm> element. It defines a DisplayString class that includes a private string constant, s, whose value is "This is a string." It also includes a ShowStringHashCode method that displays the string value and its hash code along with the name of the application domain in which the method is executing.

  code reference: System.String.GetHashCode#2

  When you run the example without supplying a configuration file, it displays output similar to the following. Note that the hash codes for the string are identical in the two application domains.

  `String 'This is a string.' in domain 'PerDomain.exe': 941BCEAC String 'This is a string.' in domain 'NewDomain': 941BCEAC`

  However, if you add the following configuration file to the example's directory and then run the example, the hash codes for the same string will differ by application domain.

  `<?xml version ="1.0"?> <configuration> <runtime> <UseRandomizedStringHashAlgorithm enabled="1" /> </runtime> </configuration>`

  When the configuration file is present, the example displays the following output:

  `String 'This is a string.' in domain 'PerDomain.exe': 5435776D String 'This is a string.' in domain 'NewDomain': 75CC8236`

  Hash codes are used to insert and retrieve keyed objects from hash tables efficiently. However, hash codes do not uniquely identify strings. Identical strings have equal hash codes, but the common language runtime can also assign the same hash code to different strings. In addition, hash codes can vary by version of the .NET Framework, by platform within a single version, and by application domain. Because of this, you should not serialize or persist hash code values, nor should you use them as keys in a hash table or dictionary.

  For additional information about the use of hash codes and the GetHashCode method, see .

  Returns the hash code for this string.

  A 32-bit signed integer hash code.

  0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.TypeCode To be added.

  Returns the for class .

  The enumerated constant, .

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 ``

  Index numbering starts from zero.

  This method performs an ordinal (culture-insensitive) search, where a character is considered equivalent to another character only if their Unicode scalar values are the same. To perform a culture-sensitive search, use the method, where a Unicode scalar value representing a precomposed character, such as the ligature "Æ" (U+00C6), might be considered equivalent to any occurrence of the character's components in the correct sequence, such as "AE" (U+0041, U+0045), depending on the culture.

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

  The zero-based index position of if that character is found, or -1 if it is not.

  A Unicode character to seek. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 `` is a null reference.

  The following example demonstrates the method.

  `using System; public class StringIndexOf { public static void Main() { String str = "This is the string"; Console.WriteLine( "Searching for the index of \"is\" yields {0,2}.", str.IndexOf( "is" ) ); Console.WriteLine( "Searching for the index of \"Is\" yields {0,2}.", str.IndexOf( "Is" ) ); Console.WriteLine( "Searching for the index of \"\" yields {0,2}.", str.IndexOf( "" ) ); } }`

  The output is

  Searching for the index of "is" yields 2.

  Searching for the index of "Is" yields -1.

  Searching for the index of "" yields 0.

  Index numbering starts from zero.

  This method performs a word (case-sensitive and culture-sensitive) search using the current culture. The search begins at the first character position of this instance and continues until the last character position.

  Character sets include ignorable characters, which are characters that are not considered when performing a linguistic or culture-sensitive comparison. In a culture-sensitive search, if contains an ignorable character, the result is equivalent to searching with that character removed. If consists only of one or more ignorable characters, the method always returns 0 (zero) to indicate that the match is found at the beginning of the current instance. In the following example, the method is used to find three substrings (a soft hyphen (U+00AD), a soft hyphen followed by "n", and a soft hyphen followed by "m") in two strings. Only one of the strings contains a soft hyphen. In each case, because the soft hyphen is an ignorable character, the result is the same as if the soft hyphen had not been included in . When searching for a soft hyphen only, the method returns 0 (zero) to indicate that it has found a match at the beginning of the string.

  code reference: System.String.IndexOf#21

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

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

  The string to seek. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 `` `` is less than zero or greater than the length of the current instance.

  The following example demonstrates the method.

  `using System; public class StringIndexOf { public static void Main() { String str = "This is the string"; Console.WriteLine( "Searching for the index of 'h' starting from index 0 yields {0}.", str.IndexOf( 'h', 0 ) ); Console.WriteLine( "Searching for the index of 'h' starting from index 10 yields {0}.", str.IndexOf( 'h', 10 ) ); } }`

  The output is

  Searching for the index of 'h' starting from index 0 yields 1.

  Searching for the index of 'h' starting from index 10 yields -1.

  Index numbering starts from 0. The parameter can range from 0 to the length of the string instance. If equals the length of the string instance, the method returns -1.

  The search ranges from to the end of the string.

  This method performs an ordinal (culture-insensitive) search, where a character is considered equivalent to another character only if their Unicode scalar values are the same. To perform a culture-sensitive search, use the method, where a Unicode scalar value representing a precomposed character, such as the ligature "Æ" (U+00C6), might be considered equivalent to any occurrence of the character's components in the correct sequence, such as "AE" (U+0041, U+0045), depending on the culture.

  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.

  The zero-based index position of if that character is found, or -1 if it is not.

  A Unicode character to seek. The search starting position. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 `` `` is a null reference.

  is greater than the length of the current instance.

  Index numbering starts from 0. The parameter can range from 0 to the length of the string instance. If equals the length of the string instance, the method returns -1.

  This method performs a word (case-sensitive and culture-sensitive) search using the current culture. The search begins at the character position of this instance and continues until the last character position.

  Character sets include ignorable characters, which are characters that are not considered when performing a linguistic or culture-sensitive comparison. In a culture-sensitive search, if contains an ignorable character, the result is equivalent to searching with that character removed. If consists only of one or more ignorable characters, the method always returns , which is the character position at which the search begins. In the following example, the method is used to find the position of a soft hyphen (U+00AD) followed by an "m" in two strings. Only one of the strings contains the required substring. In both cases, because the soft hyphen is an ignorable character, the method returns the index of "m" in the string. Note that in the case of the first string, which includes the soft hyphen followed by an "m", the method fails to return the index of the soft hyphen but instead returns the index of the "m".

  code reference: System.String.IndexOf#22

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

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

  The string to seek. The search starting position. 0
- Method
  2.0.0.0
  4.0.0.0
  System.Int32 `` ``

  Index numbering starts from zero.

  The parameter specifies to search for the parameter using the current or invariant culture, using a case-sensitive or case-insensitive search, and using word or ordinal comparison rules.

  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.

  The index position of the parameter if that string is found, or -1 if it is not. If is , the return value is 0.

  The string to seek. One of the enumeration values that specifies the rules for the search.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 `` `` ``

  or is negative

  -or-

  + is greater than the length of the current instance.

  The search begins at and continues to + -1. The character at + is not included in the search.

  Index numbering starts from 0 (zero). The parameter can range from 0 to the length of the string instance.

  This method performs an ordinal (culture-insensitive) search, where a character is considered equivalent to another character only if their Unicode scalar values are the same. To perform a culture-sensitive search, use the method, where a Unicode scalar value representing a precomposed character, such as the ligature "Æ" (U+00C6), might be considered equivalent to any occurrence of the character's components in the correct sequence, such as "AE" (U+0041, U+0045), depending on the culture.

  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.

  The zero-based index position of if that character is found, or -1 if it is not.

  A Unicode character to seek. The search starting position. The number of character positions to examine. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 `` `` `` is a null reference.

  or is negative

  -or-

  + is greater than the length of the current instance.

  Index numbering starts from 0 (zero). The parameter can range from 0 to the length of the string instance.

  This method performs a word (case-sensitive and culture-sensitive) search using the current culture. The search begins at and continues to + -1. The character at + is not included in the search.

  Character sets include ignorable characters, which are characters that are not considered when performing a linguistic or culture-sensitive comparison. In a culture-sensitive search, if contains an ignorable character, the result is equivalent to searching with that character removed. If consists only of one or more ignorable characters, the method always returns , which is the character position at which the search begins. In the following example, the method is used to find the position of a soft hyphen (U+00AD) followed by an "m" starting in the third through sixth character positions in two strings. Only one of the strings contains the required substring. In both cases, because the soft hyphen is an ignorable character, the method returns the index of "m" in the string when it performs a culture-sensitive comparison. Note that in the case of the first string, which includes the soft hyphen followed by an "m", the method fails to return the index of the soft hyphen but instead returns the index of the "m".

  code reference: System.String.IndexOf#23

  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.

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

  The string to seek. The search starting position. The number of character positions to examine. 0
- Method
  2.0.0.0
  4.0.0.0
  System.Int32 `` `` ``

  Index numbering starts from 0. The parameter can range from 0 to the length of the string instance. If equals the length of the string instance, the method returns -1.

  The parameter specifies to search for the parameter using the current or invariant culture, using a case-sensitive or case-insensitive search, and using word or ordinal comparison rules.

  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.

  The zero-based index position of the parameter if that string is found, or -1 if it is not. If is , the return value is .

  The string to seek. The search starting position. One of the enumeration values that specifies the rules for the search.
- Method
  2.0.0.0
  4.0.0.0
  System.Int32 `` `` `` ``

  Index numbering starts from 0 (zero). The parameter can range from 0 to the length of the string instance.

  The search begins at and continues to + -1. The character at + is not included in the search.

  The parameter specifies to search for the parameter using the current or invariant culture, using a case-sensitive or case-insensitive search, and using word or ordinal comparison rules.

  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.

  The zero-based index position of the parameter if that string is found, or -1 if it is not. If is , the return value is .

  The string to seek. The search starting position. The number of character positions to examine. One of the enumeration values that specifies the rules for the search.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 `` is a null reference.

  Index numbering starts from zero.

  The search for is case-sensitive.

  This method performs an ordinal (culture-insensitive) search, where a character is considered equivalent to another character only if their Unicode scalar value are the same. To perform a culture-sensitive search, use the method, where a Unicode scalar value representing a precomposed character, such as the ligature "Æ" (U+00C6), might be considered equivalent to any occurrence of the character's components in the correct sequence, such as "AE" (U+0041, U+0045), depending on the culture.

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

  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.

  A Unicode character array containing one or more characters to seek. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 `` `` is a null reference. is greater than the length of the current instance

  Index numbering starts from zero. The parameter can range from 0 to one less than the length of the string instance.

  The search ranges from to the end of the string.

  The search for is case-sensitive.

  This method performs an ordinal (culture-insensitive) search, where a character is considered equivalent to another character only if their Unicode scalar value are the same. To perform a culture-sensitive search, use the method, where a Unicode scalar value representing a precomposed character, such as the ligature "Æ" (U+00C6), might be considered equivalent to any occurrence of the character's components in the correct sequence, such as "AE" (U+0041, U+0045), depending on the culture.

  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.

  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.

  A Unicode character array containing one or more characters to seek. The search starting position. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 `` `` `` is a null reference.

  or is negative.

  -or-

  + is greater than the length of the current instance.

  The search begins at and continues to + -1. The character at + is not included in the search.

  Index numbering starts from zero. The parameter can range from 0 to one less than the length of the string instance.

  The search for is case-sensitive.

  This method performs an ordinal (culture-insensitive) search, where a character is considered equivalent to another character only if their Unicode scalar value are the same. To perform a culture-sensitive search, use the method, where a Unicode scalar value representing a precomposed character, such as the ligature "Æ" (U+00C6), might be considered equivalent to any occurrence of the character's components in the correct sequence, such as "AE" (U+0041, U+0045), depending on the culture.

  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.

  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.

  A Unicode character array containing one or more characters to seek. The search starting position. The number of character positions to examine. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.String `` `` is a null reference.

  is greater than the length of the current instance.

  If is equal to the length of this instance, is appended to the end of this instance.

  This method does not modify the value of the current instance. Instead, it returns a new string in which is inserted into the current instance.

  For example, the return value of "abc".Insert(2, "XYZ") is "abXYZc".

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

  A new string that is equivalent to this instance, but with inserted at position .

  The zero-based index position of the insertion. The string to insert. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.String `` is a null reference.

  The following example demonstrates the method.

  `using System; using System.Text; public class StringExample { public static void Main() { String s1 = "MyTest"; String s2 = new StringBuilder().Append("My").Append("Test").ToString(); String s3 = String.Intern(s2); Console.WriteLine(Object.ReferenceEquals(s1, s2)); //different Console.WriteLine(Object.ReferenceEquals(s1, s3)); //the same } }`

  The output is

  False

  True

  The common language runtime conserves string storage by maintaining a table, called the intern pool, that contains a single reference to each unique literal string declared or created programmatically in your program. Consequently, an instance of a literal string with a particular value only exists once in the system.

  For example, if you assign the same literal string to several variables, the runtime retrieves the same reference to the literal string from the intern pool and assigns it to each variable.

  The method uses the intern pool to search for a string equal to the value of . If such a string exists, its reference in the intern pool is returned. If the string does not exist, a reference to is added to the intern pool, then that reference is returned.

  In the following example, the string s1, which has a value of "MyTest", is already interned because it is a literal in the program. The class generates a new string object that has the same value as s1. A reference to that string is assigned to s2. The method searches for a string that has the same value as s2. Because such a string exists, the method returns the same reference that is assigned to s1. That reference is then assigned to s3. References s1 and s2 compare unequal because they refer to different objects; references s1 and s3 compare equal because they refer to the same string.

  code reference: System.String.Intern#1

  Compare this method to the method.

  ## Version Considerations

  In the net_v35SP1_long, the method reverts to its behavior in the .NET Framework 1.0 and 1.1 with regard to interning the empty string. In the following example, the variable str1 is assigned a reference to , and the variable str2 is assigned the reference to that is returned by calling the method after converting a object whose value is to a string. Then the references contained in str1 and str2 are compared for equality.

  code reference: System.String.Intern#2

  In the net_v10_short, net_v11_short, and net_v35SP1_short, str1 and str2 are equal. In the net_v20SP1_long and net_v30_long, str1 and str2 are not equal.

  ## Performance Considerations

  If you are trying to reduce the total amount of memory your application allocates, keep in mind that interning a string has two unwanted side effects. First, the memory allocated for interned objects is not likely be released until the common language runtime (CLR) terminates. The reason is that the CLR's reference to the interned object can persist after your application, or even your application domain, terminates. Second, to intern a string, you must first create the string. The memory used by the object must still be allocated, even though the memory will eventually be garbage collected.

  The .NET Framework version 2.0 introduces the enumeration member. The member marks an assembly as not requiring string-literal interning. You can apply to an assembly using the attribute. Also, when you use the Native Image Generator (Ngen.exe) to compile an assembly in advance of run time, strings are not interned across modules.

  Retrieves the system's reference to the specified .

  The system's reference to , if it is interned; otherwise, a new reference to a string with the value of .

  A string to search for in the intern pool. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.String `` is a null reference.

  The following example demonstrates the method.

  `using System; using System.Text; public class StringExample { public static void Main() { String s1 = new StringBuilder().Append("My").Append("Test").ToString(); Console.WriteLine(String.IsInterned(s1) != null); } }`

  The output is

  True

  The common language runtime automatically maintains a table, called the intern pool, which contains a single instance of each unique literal string constant declared in a program, as well as any unique instance of you add programmatically by calling the method.

  The intern pool conserves string storage. If you assign a literal string constant to several variables, each variable is set to reference the same constant in the intern pool instead of referencing several different instances of that have identical values.

  This method looks up in the intern pool. If has already been interned, a reference to that instance is returned; otherwise, null is returned.

  Compare this method to the method.

  This method does not return a Boolean value. If you call the method because you want a Boolean value that indicates whether a particular string is interned, you can use code such as the following.

  code reference: System.String.IsInterned#1

  Starting with the .NET Framework version 2.0, you can override the use of the intern pool when you use the Native Image Generator (Ngen.exe) to install an assembly to the native image cache on a local computer. For more information, see Performance Considerations in the Remarks section for the property.

  Retrieves a reference to a specified .

  A reference to if it is in the common language runtime intern pool; otherwise, null.

  The string to search for in the intern pool. 0
- Method
  2.0.0.0
  4.0.0.0
  System.Boolean

  Some Unicode characters have multiple equivalent binary representations consisting of sets of combining and/or composite Unicode characters. The existence of multiple representations for a single character complicates searching, sorting, matching, and other operations.

  The Unicode standard defines a process called normalization that returns one binary representation when given any of the equivalent binary representations of a character. Normalization can be performed with several algorithms, called normalization forms, that obey different rules. The .NET Framework currently supports normalization forms C, D, KC, and KD.

  For a description of supported Unicode normalization forms, see .

  Indicates whether this string is in Unicode normalization form C.

  true if this string is in normalization form C; otherwise, false.

- Method
  2.0.0.0
  4.0.0.0
  System.Boolean ``

  Some Unicode characters have multiple equivalent binary representations consisting of sets of combining and/or composite Unicode characters. The existence of multiple representations for a single character complicates searching, sorting, matching, and other operations.

  The Unicode standard defines a process called normalization that returns one binary representation when given any of the equivalent binary representations of a character. Normalization can be performed with several algorithms, called normalization forms, that obey different rules. The .NET Framework currently supports normalization forms C, D, KC, and KD.

  For a description of supported Unicode normalization forms, see .

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

  true if this string is in the normalization form specified by the parameter; otherwise, false.

  A Unicode normalization form.
- Method
  2.0.0.0
  4.0.0.0
  System.Boolean ``

  is a convenience method that enables you to simultaneously test whether a is null or its value is . It is equivalent to the following code:

  code reference: System.String.IsNullOrEmpty#1

  You can use the method to test whether a string is null, its value is , or it consists only of white-space characters.

  Indicates whether the specified string is null or an string.

  true if the parameter is null or an empty string (""); otherwise, false.

  The string to test.
- Method
  4.0.0.0
  System.Boolean ``

  is a convenience method that is similar to the following code, except that it offers superior performance:

  code reference: System.String.IsNullOrWhitespace#2

  White-space characters are defined by the Unicode standard. The method interprets any character that returns a value of true when it is passed to the method as a white-space character.

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

  true if the parameter is null or , or if consists exclusively of white-space characters.

  The string to test.
- Method
  4.0.0.0
  System.Runtime.InteropServices.ComVisible(false)
  System.String `` ``

  If is null, an empty string () is used instead. If any member of is null, an empty string is used instead.

  is a convenience method that lets you concatenate each element in an IEnumerable(Of String) collection without first converting the elements to a string array. It is particularly useful with Language-Integrated Query (LINQ) query expressions. The following example passes a List(Of String) object that contains either the uppercase or lowercase letters of the alphabet to a lambda expression that selects letters that are equal to or greater than a particular letter (which, in the example, is "M"). The IEnumerable(Of String) collection returned by the method is passed to the method to display the result as a single string.

  code reference: System.String.Join#4

  Concatenates the members of a constructed collection of type , using the specified separator between each member.

  A string that consists of the members of delimited by the string. If has no members, the method returns .

  The string to use as a separator. is included in the returned string only if has more than one element. A collection that contains the strings to concatenate.
- Method
  4.0.0.0
  System.Runtime.InteropServices.ComVisible(false)
  System.String `` `System.ParamArray`

  If is null or if any element of other than the first element is null, an empty string () is used instead. See the Notes for Callers section if the first element of is null.

  is a convenience method that lets you concatenate each element in an object array without explicitly converting its elements to strings. The string representation of each object in the array is derived by calling that object's ToString method.

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

  A string that consists of the elements of delimited by the string. If is an empty array, the method returns .

  The string to use as a separator. is included in the returned string only if has more than one element. An array that contains the elements to concatenate.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.String `` `System.ParamArray` is a null reference.

  The following example demonstrates the method.

  `using System; public class StringJoin { public static void Main() { String[] strAry = { "Red" , "Green" , "Blue" }; Console.WriteLine( String.Join( " :: ", strAry ) ); } }`

  The output is

  Red :: Green :: Blue

  For example, if is ", " and the elements of are "apple", "orange", "grape", and "pear", Join(separator, value) returns "apple, orange, grape, pear".

  If is null, an empty string () is used instead. If any element in is null, an empty string is used instead.

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

  A string that consists of the elements in delimited by the string. If is an empty array, the method returns .

  The string to use as a separator. is included in the returned string only if has more than one element. An array that contains the elements to concatenate. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.String `` `` `` `` plus is greater than the number of elements in .

  The following example demonstrates the method.

  `using System; public class StringJoin { public static void Main() { String[] strAry = { "Red" , "Green" , "Blue" }; Console.WriteLine( String.Join( " :: ", strAry, 1, 2 ) ); } }`

  The output is

  Green :: Blue

  For example, if is ", " and the elements of are "apple", "orange", "grape", and "pear", Join(separator, value, 1, 2) returns "orange, grape".

  If is null, an empty string () is used instead. If any element in is null, an empty string is used instead.

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

  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 .

  The string to use as a separator. is included in the returned string only if has more than one element. An array that contains the elements to concatenate. The first element in to use. The number of elements of to use. 0
- Method
  4.0.0.0
  System.Runtime.InteropServices.ComVisible(false)
  System.String `` ``

  If is null, an empty string () is used instead. If any member of is null, an empty string is used instead.

  is a convenience method that lets you concatenate each member of an collection without first converting them to strings. The string representation of each object in the collection is derived by calling that object's ToString method.

  This method is particular useful with Language-Integrated Query (LINQ) query expressions. For example, the following code defines a very simple Animal class that contains the name of an animal and the order to which it belongs. It then defines a object that contains a number of Animal objects. The extension method is called to extract the Animal objects whose Order property equals "Rodent". The result is passed to the method.

  code reference: System.String.Join#5

  Concatenates the members of a collection, using the specified separator between each member.

  A string that consists of the members of delimited by the string. If has no members, the method returns .

  The string to use as a separator. is included in the returned string only if has more than one element. A collection that contains the objects to concatenate. The type of the members of .
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 ``

  Index numbering starts from zero. That is, the first character in the string is at index zero and the last is at - 1.

  This method begins searching at the last character position of this instance and proceeds backward toward the beginning until either is found or the first character position has been examined. The search is case-sensitive.

  This method performs an ordinal (culture-insensitive) search, where a character is considered equivalent to another character only if their Unicode scalar values are the same. To perform a culture-sensitive search, use the method, where a Unicode scalar value representing a precomposed character, such as the ligature "Æ" (U+00C6), might be considered equivalent to any occurrence of the character's components in the correct sequence, such as "AE" (U+0041, U+0045), depending on the culture.

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

  The zero-based index position of if that character is found, or -1 if it is not.

  The Unicode character to seek. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 `` is a null reference.

  Index numbering starts from zero. That is, the first character in the string is at index zero and the last is at - 1.

  The search begins at the last character position of this instance and proceeds backward toward the beginning until either is found or the first character position has been examined.

  This method performs a word (case-sensitive and culture-sensitive) search using the current culture.

  Character sets include ignorable characters, which are characters that are not considered when performing a linguistic or culture-sensitive comparison. In a culture-sensitive search, if contains an ignorable character, the result is equivalent to searching with that character removed. If consists only of one or more ignorable characters, the method always returns – 1, which represents the last index position in the current instance. In the following example, the method is used to find three substrings (a soft hyphen (U+00AD), a soft hyphen followed by "n", and a soft hyphen followed by "m") in two strings. Only one of the strings contains a soft hyphen. In each case, because the soft hyphen is an ignorable character, the result is the same as if the soft hyphen had not been included in . When searching for a soft hyphen only, the method returns 6 and 5. These values correspond to the index of the last character in the two strings.

  code reference: System.String.LastIndexOf#21

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

  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.

  The string to seek. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 `` `` is a null reference. is less than zero or greater than the length of the current instance.

  The following example demonstrates the method.

  `using System; public class StringLastIndexOfTest { public static void Main() { String str = "aa bb cc dd"; Console.WriteLine( str.LastIndexOf('d', 8) ); Console.WriteLine( str.LastIndexOf('b', 8) ); } }`

  The output is

  -1

  4

  Index numbering starts from zero. That is, the first character in the string is at index zero and the last is at - 1.This method begins searching at the character position of this instance and proceeds backward toward the beginning of the current instance until either is found or the first character position has been examined. For example, if is - 1, the method searches every character from the last character in the string to the beginning. The search is case-sensitive.

  This method performs an ordinal (culture-insensitive) search, where a character is considered equivalent to another character only if their Unicode scalar values are the same. To perform a culture-sensitive search, use the method, where a Unicode scalar value representing a precomposed character, such as the ligature "Æ" (U+00C6), might be considered equivalent to any occurrence of the character's components in the correct sequence, such as "AE" (U+0041, U+0045), depending on the culture.

  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.

  The zero-based index position of if that character is found, or -1 if it is not found or if the current instance equals .

  The Unicode character to seek. The starting position of the search. The search proceeds from toward the beginning of this instance. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 `` `` is a null reference. is less than zero or greater than or equal to the length of the current instance.

  Index numbering starts from zero. That is, the first character in the string is at index zero and the last is at - 1.

  The search begins at the character position of this instance and proceeds backward toward the beginning until either is found or the first character position has been examined. For example, if is - 1, the method searches every character from the last character in the string to the beginning.

  This method performs a word (case-sensitive and culture-sensitive) search using the current culture.

  Character sets include ignorable characters, which are characters that are not considered when performing a linguistic or culture-sensitive comparison. In a culture-sensitive search, if contains an ignorable character, the result is equivalent to searching with that character removed. If consists only of one or more ignorable characters, the method always returns , which is the character position at which the search begins. In the following example, the method is used to find a substring that includes a soft hyphen (U+00AD) and that precedes or includes the final "m" in a string. Because the soft hyphen in the search string is ignored, calling the method to find a substring that consists of the soft hyphen and "m" returns the position of the "m" in the string, whereas calling it to find a substring that consists of the soft hyphen and "n" returns the position of the "n". When the search string contains only the soft hyphen, the method returns the index of the "m", which represents the value of .

  code reference: System.String.LastIndexOf#22

  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.

  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.

  The string to seek. The search starting position. The search proceeds from toward the beginning of this instance. 0
- Method
  2.0.0.0
  4.0.0.0
  System.Int32 `` ``

  Index numbering starts from zero. That is, the first character in the string is at index zero and the last is at - 1.

  The parameter specifies to search for the parameter using the current or invariant culture, using a case-sensitive or case-insensitive search, and using word or ordinal comparison rules.

  The search begins at the last character position of this instance and proceeds backward toward the beginning until either is found or the first character position has been examined.

  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.

  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.

  The string to seek. One of the enumeration values that specifies the rules for the search.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 `` `` `` is a null reference.

  or is less than zero.

  -or-

  - is less than -1.

  Index numbering starts from zero. That is, the first character in the string is at index zero and the last is at - 1.

  This method begins searching at the character position and proceeds backward toward the beginning of this instance until either is found or character positions have been examined. For example, if is - 1, the method searches backward characters from the last character in the string. The search is case-sensitive.

  This method performs an ordinal (culture-insensitive) search, where a character is considered equivalent to another character only if their Unicode scalar value are the same. To perform a culture-sensitive search, use the method, where a Unicode scalar value representing a precomposed character, such as the ligature "Æ" (U+00C6), might be considered equivalent to any occurrence of the character's components in the correct sequence, such as "AE" (U+0041, U+0045), depending on the culture.

  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.

  The zero-based index position of if that character is found, or -1 if it is not found or if the current instance equals .

  The Unicode character to seek. The starting position of the search. The search proceeds from toward the beginning of this instance. The number of character positions to examine. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 `` `` `` is a null reference.

  or is less than zero.

  -or-

  - is smaller than -1.

  Index numbering starts from zero. That is, the first character in the string is at index zero and the last is at - 1.

  The search begins at the character position of this instance and proceeds backward toward the beginning until either is found or character positions have been examined. For example, if is - 1, the method searches backward characters from the last character in the string.

  This method performs a word (case-sensitive and culture-sensitive) search using the current culture.

  Character sets include ignorable characters, which are characters that are not considered when performing a linguistic or culture-sensitive comparison. In a culture-sensitive search, if contains an ignorable character, the result is equivalent to searching with that character removed. If consists only of one or more ignorable characters, the method always returns , which is the character position at which the search begins. In the following example, the method is used to find the position of a soft hyphen (U+00AD) in the two characters that precede the final "m" of two strings. Only one of the strings contains the required substring. In both cases, because the soft hyphen is an ignorable character, the method returns the index of "m" in the string when it performs a culture-sensitive comparison. Note that in the case of the first string, which includes the soft hyphen followed by an "m", the method fails to return the index of the soft hyphen but instead returns the index of the "m".

  code reference: System.String.LastIndexOf#23

  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.

  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.

  The string to seek. The search starting position. The search proceeds from toward the beginning of this instance. The number of character positions to examine. 0
- Method
  2.0.0.0
  4.0.0.0
  System.Int32 `` `` ``

  Index numbering starts from zero. That is, the first character in the string is at index zero and the last is at - 1.

  The search begins at the character position and proceeds backward until either is found or the first character position has been examined. For example, if is - 1, the method searches every character from the last character in the string to the beginning.

  The parameter specifies to search for the parameter using the current or invariant culture, using a case-sensitive or case-insensitive search, and using word or ordinal comparison rules.

  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.

  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.

  The string to seek. The search starting position. The search proceeds from toward the beginning of this instance. One of the enumeration values that specifies the rules for the search.
- Method
  2.0.0.0
  4.0.0.0
  System.Int32 `` `` `` ``

  Index numbering starts from zero. That is, the first character in the string is at index zero and the last is at - 1.

  The search begins at the character position and proceeds backward until either is found or character positions have been examined. For example, if is - 1, the method searches backward characters from the last character in the string.

  The parameter specifies to search for the parameter using the current or invariant culture, using a case-sensitive or case-insensitive search, and using word or ordinal comparison rules.

  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.

  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.

  The string to seek. The search starting position. The search proceeds from toward the beginning of this instance. The number of character positions to examine. One of the enumeration values that specifies the rules for the search.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 `` is a null reference.

  Index numbering starts from zero.

  This method begins searching at the last character position of this instance and proceeds backward toward the beginning until either a character in is found or the first character position has been examined. The search is case-sensitive.

  This method performs an ordinal (culture-insensitive) search, where a character is considered equivalent to another character only if their Unicode scalar values are the same. To perform a culture-sensitive search, use the method, where a Unicode scalar value representing a precomposed character, such as the ligature "Æ" (U+00C6), might be considered equivalent to any occurrence of the character's components in the correct sequence, such as "AE" (U+0041, U+0045), depending on the culture.

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

  The index position of the last occurrence in this instance where any character in was found; -1 if no character in was found.

  A Unicode character array containing one or more characters to seek. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 `` `` is a null reference.

  is less than zero or greater than or equal to the length of the current instance.

  Index numbering starts from zero.

  This method begins searching at the character position of this instance and proceeds backward toward the beginning until either a character in is found or the first character position has been examined. The search is case-sensitive.

  This method performs an ordinal (culture-insensitive) search, where a character is considered equivalent to another character only if their Unicode scalar values are the same. To perform a culture-sensitive search, use the method, where a Unicode scalar value representing a precomposed character, such as the ligature "Æ" (U+00C6), might be considered equivalent to any occurrence of the character's components in the correct sequence, such as "AE" (U+0041, U+0045), depending on the culture.

  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.

  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 .

  A Unicode character array containing one or more characters to seek. The search starting position. The search proceeds from toward the beginning of this instance. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 `` `` `` is a null reference.

  or is less than zero.

  -or-

  - is smaller than -1.

  Index numbering starts from zero.

  This method begins searching at the character position of this instance and proceeds backward toward the beginning until either a character in is found or character positions have been examined. The search is case-sensitive.

  This method performs an ordinal (culture-insensitive) search, where a character is considered equivalent to another character only if their Unicode scalar values are the same. To perform a culture-sensitive search, use the method, where a Unicode scalar value representing a precomposed character, such as the ligature "Æ" (U+00C6), might be considered equivalent to any occurrence of the character's components in the correct sequence, such as "AE" (U+0041, U+0045), depending on the culture.

  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.

  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 .

  A Unicode character array containing one or more characters to seek. The search starting position. The search proceeds from toward the beginning of this instance. The number of character positions to examine. 0
- Property
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32

  A containing the number of characters in the current instance.

  The following example demonstrates the property.

  `using System; public class StringLengthExample { public static void Main() { string str = "STRING"; Console.WriteLine( "The length of string {0} is {1}", str, str.Length ); } }`

  The output is

  The length of string STRING is 6

  The property returns the number of objects in this instance, not the number of Unicode characters. The reason is that a Unicode character might be represented by more than one . Use the class to work with each Unicode character instead of each .

  In some languages, such as C and C++, a null character indicates the end of a string. In the .NET Framework, a null character can be embedded in a string. When a string includes one or more null characters, they are included in the length of the total string. For example, in the following string, the substrings "abc" and "def" are separated by a null character. The property returns 7, which indicates that it includes the six alphabetic characters as well as the null character.

  code reference: System.String.Class#1

  Gets the number of characters in the current object.

  0
- Method
  2.0.0.0
  4.0.0.0
  System.String

  Some Unicode characters have multiple equivalent binary representations consisting of sets of combining and/or composite Unicode characters. For example, any of the following code points can represent the letter "ắ":

  U+1EAF

  U+0103 U+0301

  U+0061 U+0306 U+0301

  The existence of multiple representations for a single character complicates searching, sorting, matching, and other operations.

  The Unicode standard defines a process called normalization that returns one binary representation when given any of the equivalent binary representations of a character. Normalization can be performed with several algorithms, called normalization forms, that obey different rules. The .NET Framework supports the four normalization forms (C, D, KC, and KD) that are defined by the Unicode standard. When two strings are represented in the same normalization form, they can be compared by using ordinal comparison.

  To normalize and compare two strings, do the following:

  Obtain the strings to be compared from an input source, such as a file or a user input device.

  Call the method to normalize the strings to normalization form C.

  To compare two strings, call a method that supports ordinal string comparison, such as the method, and supply a value of or as the argument. To sort an array of normalized strings, pass a value of or to an appropriate overload of .

  Emit the strings in the sorted output based on the order indicated by the previous step.

  For a description of supported Unicode normalization forms, see .

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

  A new, normalized string whose textual value is the same as this string, but whose binary representation is in normalization form C.

- Method
  2.0.0.0
  4.0.0.0
  System.String ``

  Some Unicode characters have multiple equivalent binary representations consisting of sets of combining and/or composite Unicode characters. The existence of multiple representations for a single character complicates searching, sorting, matching, and other operations.

  The Unicode standard defines a process called normalization that returns one binary representation when given any of the equivalent binary representations of a character. Normalization can be performed with several algorithms, called normalization forms, that obey different rules. The .NET Framework supports the four normalization forms (C, D, KC, and KD) that are defined by the Unicode standard. When two strings are represented in the same normalization form, they can be compared by using ordinal comparison.

  To normalize and compare two strings, do the following:

  Obtain the strings to be compared from an input source, such as a file or a user input device.

  Call the method to normalize the strings to a specified normalization form.

  To compare two strings, call a method that supports ordinal string comparison, such as the method, and supply a value of or as the argument. To sort an array of normalized strings, pass a value of or to an appropriate overload of .

  Emit the strings in the sorted output based on the order indicated by the previous step.

  For a description of supported Unicode normalization forms, see .

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

  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.

  A Unicode normalization form.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Boolean `` ``

  The method defines the operation of the equality operator for the class. The operator, in turn, calls the static method, which performs an ordinal (case-sensitive and culture-insensitive) comparison.

  The Visual Basic compiler does not resolve the equality operator as a call to the method. Instead, the equality operator wraps a call to the method.

  Determines whether two specified strings have the same value.

  true if the value of is the same as the value of ; otherwise, false.

  The first string to compare, or null. The second string to compare, or null. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Boolean `` ``

  The method defines the operation of the inequality operator for the class.

  This operator is implemented using the method, which means the comparands are tested for a combination of reference and value equality. This operator performs an ordinal comparison.

  The Visual Basic compiler does not resolve the inequality operator as a call to the method. Instead, the inequality operator wraps a call to the method.

  Determines whether two specified strings have different values.

  true if the value of is different from the value of ; otherwise, false.

  The first string to compare, or null. The second string to compare, or null. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.String `` is less than zero.

  A Unicode space is defined as hexadecimal 0x0020.

  The method pads the beginning of the returned string. This means that, when used with right-to-left languages, it pads the right portion of the string.

  This method does not modify the value of the current instance. Instead, it returns a new string that is padded with leading white space so that its total length is characters.

  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.

  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.

  The number of characters in the resulting string, equal to the number of original characters plus any additional padding characters. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.String `` `` is less than zero.

  The method pads the beginning of the returned string. This means that, when used with right-to-left languages, it pads the right portion of the string.

  This method does not modify the value of the current instance. Instead, it returns a new string that is padded with leading characters so that its total length is characters.

  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.

  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.

  The number of characters in the resulting string, equal to the number of original characters plus any additional padding characters. A Unicode padding character. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.String `` is less than zero.

  A Unicode space is defined as hexadecimal 0x0020.

  The method pads the end of the returned string. This means that, when used with right-to-left languages, it pads the left portion of the string.

  This method does not modify the value of the current instance. Instead, it returns a new string that is padded with trailing white space so that its total length is characters.

  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.

  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.

  The number of characters in the resulting string, equal to the number of original characters plus any additional padding characters. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.String `` `` is less than zero.

  The method pads the end of the returned string. This means that, when used with right-to-left languages, it pads the left portion of the string.

  This method does not modify the value of the current instance. Instead, it returns a new string that is padded with trailing characters so that its total length is characters.

  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.

  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.

  The number of characters in the resulting string, equal to the number of original characters plus any additional padding characters. A Unicode padding character. 0
- Method
  2.0.0.0
  4.0.0.0
  System.String ``

  In the dnprdnshort, strings are zero-based. The value of the parameter can range from zero to one less than the length of the string instance.

  This method does not modify the value of the current instance. Instead, it returns a new string in which all characters from position to the end of the original string have been removed.

  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.

  A new string that is equivalent to this string except for the removed characters.

  The zero-based position to begin deleting characters.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.String `` ``

  or is less than zero.

  -or-

  plus is greater than the length of the current instance.

  In the dnprdnshort, strings are zero-based. The value of the parameter can range from zero to one less than the length of the string instance.

  This method does not modify the value of the current instance. Instead, it returns a new string in which the number of characters specified by the parameter have been removed. The characters are removed at the position specified by .

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

  A new string that is equivalent to this instance except for the removed characters.

  The zero-based position to begin deleting characters. The number of characters to delete. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.String `` ``

  This method performs an ordinal (case-sensitive and culture-insensitive) search to find .

  This method does not modify the value of the current instance. Instead, it returns a new string in which all occurrences of are replaced by .

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

  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.

  The Unicode character to be replaced. The Unicode character to replace all occurrences of . 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.String `` ``

  If is null, all occurrences of are removed.

  This method does not modify the value of the current instance. Instead, it returns a new string in which all occurrences of are replaced by .

  This method performs an ordinal (case-sensitive and culture-insensitive) search to find .

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

  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.

  The string to be replaced. The string to replace all occurrences of . 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.String[] `System.ParamArray`

  Delimiter characters are not included in the elements of the returned array.

  If this instance does not contain any of the characters in , the returned array consists of a single element that contains this instance.

  If the parameter is null or contains no characters, white-space characters are assumed to be the delimiters. White-space characters are defined by the Unicode standard and return true if they are passed to the method.

  Each element of defines a separate delimiter character. If two delimiters are adjacent, or a delimiter is found at the beginning or end of this instance, the corresponding array element contains . The following table provides examples.

  String value

  Separator

  Returned array

  "42, 12, 19"

  new Char[] {',', ' '} (C#)

  Char() = {","c, " "c}) (Visual Basic)

  {"42", "", "12", "", "19"}

  "42..12..19"

  new Char[] {'.'} (C#)

  Char() = {"."c} (Visual Basic)

  {"42", "", "12", "", "19"}

  "Banana"

  new Char[] {'.'} (C#)

  Char() = {"."c} (Visual Basic)

  {"Banana"}

  "Darb\nSmarba" (C#)

  "Darb" & vbLf & "Smarba" (Visual Basic)

  new Char[] {} (C#)

  Char() = {} (Visual Basic)

  {"Darb", "Smarba"}

  "Darb\nSmarba" (C#)

  "Darb" & vbLf & "Smarba" (Visual Basic)

  null (C#)

  Nothing (Visual Basic)

  {"Darb", "Smarba"}

  ## Performance Considerations

  The methods allocate memory for the returned array object and a object for each array element. If your application requires optimal performance or if managing memory allocation is critical in your application, consider using the or method, and optionally the method, to locate a substring within a string.

  If you are splitting a string at a separator character, use the or method to locate a separator character in the string. If you are splitting a string at a separator string, use the or method to locate the first character of the separator string. Then use the method to determine whether the characters after that first character are equal to the remaining characters of the separator string.

  In addition, if the same set of characters is used to split strings in multiple method calls, consider creating a single array and referencing it in each method call. This significantly reduces the additional overhead of each method call.

  Returns a string array that contains the substrings in this instance that are delimited by elements of a specified Unicode character array.

  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.

  An array of Unicode characters that delimit the substrings in this instance, an empty array that contains no delimiters, or null. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.String[] `` `` is negative.

  Delimiter characters are not included in the elements of the returned array.

  If this instance does not contain any of the characters in , the returned array consists of a single element that contains this instance. If is zero, an empty array is returned.

  If the parameter is null or contains no characters, white-space characters are assumed to be the delimiters. White-space characters are defined by the Unicode standard and return true if they are passed to the method.

  Each element of defines a separate delimiter character. If two delimiters are adjacent, or a delimiter is found at the beginning or end of this instance, the corresponding array element contains .

  If there are more than substrings in this instance, the first minus 1 substrings are returned in the first minus 1 elements of the return value, and the remaining characters in this instance are returned in the last element of the return value.

  If is greater than the number of substrings, the available substrings are returned and no exception is thrown.

  The following table provides examples.

  String value

  Separator

  Count

  Returned array

  "42, 12, 19"

  new Char[] {',', ' '} (C#)

  Char() = {","c, " "c} (Visual Basic)

  2

  {"42", " 12, 19"}

  "42..12..19"

  new Char[] {'.'} (C#)

  Char() = {"."c} (Visual Basic)

  4

  {"42", "", "12", ".19"}

  "Banana"

  new Char[] {'.'} (C#)

  Char() = {"."c} (Visual Basic)

  2

  {"Banana"}

  "Darb\nSmarba" (C#)

  "Darb" & vbLf & "Smarba" (Visual Basic)

  new Char[] {} (C#)

  Char() = {} (Visual Basic)

  1

  {"Darb\nSmarba"} (C#)

  "Darb" & vbLf & "Smarba" (Visual Basic)

  "Darb\nSmarba" (C#)

  "Darb" & vbLf & "Smarba" (Visual Basic)

  new Char[] null (C#)

  Char() = Nothing

  2

  {"Darb", "Smarba"}

  "Darb\nSmarba" (C#)

  "Darb" & vbLf & "Smarba" (Visual Basic)

  new Char[] null (C#)

  Char() = Nothing

  100

  {"Darb", "Smarba"}

  ## Performance Considerations

  The methods allocate memory for the returned array object and a object for each array element. If your application requires optimal performance or if managing memory allocation is critical in your application, consider using the or method, and optionally the method, to locate a substring within a string.

  If you are splitting a string at a separator character, use the or method to locate a separator character in the string. If you are splitting a string at a separator string, use the or method to locate the first character of the separator string. Then use the method to determine whether the characters after that first character are equal to the remaining characters of the separator string.

  In addition, if the same set of characters is used to split strings in multiple method calls, consider creating a single array and referencing it in each method call. This significantly reduces the additional overhead of each method call.

  Returns a string array that contains the substrings in this instance that are delimited by elements of a specified Unicode character array. A parameter specifies the maximum number of substrings to return.

  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.

  An array of Unicode characters that delimit the substrings in this instance, an empty array that contains no delimiters, or null. The maximum number of substrings to return. 0
- Method
  2.0.0.0
  4.0.0.0
  System.Runtime.InteropServices.ComVisible(false)
  System.String[] `` ``

  Delimiter characters are not included in the elements of the returned array.

  If this instance does not contain any of the characters in , the returned array consists of a single element that contains this instance. If the parameter is null or contains no characters, white-space characters are assumed to be the delimiters. White-space characters are defined by the Unicode standard and return true if they are passed to the method. However, if the parameter in the call to this method overload is null, compiler overload resolution fails. To unambiguously identify the called method, your code must indicate the type of the null. The following example shows several ways to unambiguously identify this overload.

  code reference: System.String.Split#5

  Each element of defines a separate delimiter character. If the parameter is and the length of this instance is zero, an empty array is returned.

  If the parameter is , and two delimiters are adjacent or a delimiter is found at the beginning or end of this instance, the corresponding array element contains .

  ## Performance Considerations

  The methods allocate memory for the returned array object and a object for each array element. If your application requires optimal performance or if managing memory allocation is critical in your application, consider using the or method, and optionally the method, to locate a substring within a string.

  If you are splitting a string at a separator character, use the or method to locate a separator character in the string. If you are splitting a string at a separator string, use the or method to locate the first character of the separator string. Then use the method to determine whether the characters after that first character are equal to the remaining characters of the separator string.

  In addition, if the same set of characters is used to split strings in multiple method calls, consider creating a single array and referencing it in each method call. This significantly reduces the additional overhead of each method call.

  Returns a string array that contains the substrings in this string that are delimited by elements of a specified Unicode character array. A parameter specifies whether to return empty array elements.

  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.

  An array of Unicode characters that delimit the substrings in this string, an empty array that contains no delimiters, or null. to omit empty array elements from the array returned; or to include empty array elements in the array returned.
- Method
  2.0.0.0
  4.0.0.0
  System.Runtime.InteropServices.ComVisible(false)
  System.String[] `` ``

  ## Return value details

  Delimiter strings are not included in the elements of the returned array.

  If this instance does not contain any of the strings in , the returned array consists of a single element that contains this instance. If the parameter is null or contains no characters, white-space characters are assumed to be the delimiters. White-space characters are defined by the Unicode standard and return true if they are passed to the method. However, if the parameter in the call to this method overload is null, compiler overload resolution fails. To unambiguously identify the called method, your code must indicate the type of the null. The following example shows several ways to unambiguously identify this overload.

  code reference: System.String.Split#6

  If the parameter is and the length of this instance is zero, an empty array is returned.

  Each element of defines a separate delimiter that consists of one or more characters. If the parameter is , and two delimiters are adjacent or a delimiter is found at the beginning or end of this instance, the corresponding array element contains .

  ## The separator array

  If any of the elements in consists of more than a single character, only the first character of that element is considered a delimiter, and any subsequent characters are ignored. For example, if one of the elements in is "10", attempting to split the string "This10is10a10string." returns the following four-element array: { "This", "0is", "0a", "0string." }.

  ## Comparison details

  The method extracts the substrings in this string that are delimited by one or more of the strings in the parameter, and returns those substrings as elements of an array.

  The method looks for delimiters by performing comparisons using case-sensitive ordinal sort rules. For more information about word, string, and ordinal sorts, see the enumeration.

  The method ignores any element of whose value is null or the empty string ("").

  To avoid ambiguous results when strings in have characters in common, the operation proceeds from the beginning to the end of the value of the instance, and matches the first element in that is equal to a delimiter in the instance. The order in which substrings are encountered in the instance takes precedence over the order of elements in .

  For example, consider an instance whose value is "abcdef". If the first element in was "ef" and the second element was "bcde", the result of the split operation would be "a" and "f". This is because the substring in the instance, "bcde", is encountered and matches an element in before the substring "f" is encountered.

  However, if the first element of was "bcd" and the second element was "bc", the result of the split operation would be "a" and "ef". This is because "bcd" is the first delimiter in that matches a delimiter in the instance. If the order of the separators was reversed so the first element was "bc" and the second element was "bcd", the result would be "a" and "def".

  ## Performance considerations

  The methods allocate memory for the returned array object and a object for each array element. If your application requires optimal performance or if managing memory allocation is critical in your application, consider using the or method, and optionally the method, to locate a substring within a string.

  If you are splitting a string at a separator character, use the or method to locate a separator character in the string. If you are splitting a string at a separator string, use the or method to locate the first character of the separator string. Then use the method to determine whether the characters after that first character are equal to the remaining characters of the separator string.

  In addition, if the same set of characters is used to split strings in multiple method calls, consider creating a single array and referencing it in each method call. This significantly reduces the additional overhead of each method call.

  Returns a string array that contains the substrings in this string that are delimited by elements of a specified string array. A parameter specifies whether to return empty array elements.

  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.

  An array of single-character strings that delimit the substrings in this string, an empty array that contains no delimiters, or null. to omit empty array elements from the array returned; or to include empty array elements in the array returned.
- Method
  2.0.0.0
  4.0.0.0
  System.Runtime.InteropServices.ComVisible(false)
  System.String[] `` `` ``

  Delimiter characters are not included in the elements of the returned array.

  If this instance does not contain any of the characters in , or the parameter is 1, the returned array consists of a single element that contains this instance. If the parameter is null or contains no characters, white-space characters are assumed to be the delimiters. White-space characters are defined by the Unicode standard and return true if they are passed to the method. However, if the parameter in the call to this method overload is null, compiler overload resolution fails. To unambiguously identify the called method, your code must indicate the type of the null. The following example shows several ways to unambiguously identify this overload.

  code reference: System.String.Split#3

  If the parameter is zero, or the parameter is and the length of this instance is zero, an empty array is returned.

  Each element of defines a separate delimiter character. If the parameter is , and two delimiters are adjacent or a delimiter is found at the beginning or end of this instance, the corresponding array element contains .

  If there are more than substrings in this instance, the first minus 1 substrings are returned in the first minus 1 elements of the return value, and the remaining characters in this instance are returned in the last element of the return value.

  If is greater than the number of substrings, the available substrings are returned and no exception is thrown.

  ## Performance Considerations

  The methods allocate memory for the returned array object and a object for each array element. If your application requires optimal performance or if managing memory allocation is critical in your application, consider using the or method, and optionally the method, to locate a substring within a string.

  If you are splitting a string at a separator character, use the or method to locate a separator character in the string. If you are splitting a string at a separator string, use the or method to locate the first character of the separator string. Then use the method to determine whether the characters after that first character are equal to the remaining characters of the separator string.

  In addition, if the same set of characters is used to split strings in multiple method calls, consider creating a single array and referencing it in each method call. This significantly reduces the additional overhead of each method call.

  Returns a string array that contains the substrings in this string that are delimited by elements of a specified Unicode character array. Parameters specify the maximum number of substrings to return and whether to return empty array elements.

  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.

  An array of Unicode characters that delimit the substrings in this string, an empty array that contains no delimiters, or null. The maximum number of substrings to return. to omit empty array elements from the array returned; or to include empty array elements in the array returned.
- Method
  2.0.0.0
  4.0.0.0
  System.Runtime.InteropServices.ComVisible(false)
  System.String[] `` `` ``

  ## Return value details

  Delimiter strings are not included in the elements of the returned array.

  If this instance does not contain any of the strings in , or the parameter is 1, the returned array consists of a single element that contains this instance. If the parameter is null or contains no characters, white-space characters are assumed to be the delimiters. White-space characters are defined by the Unicode standard and return true if they are passed to the method. However, if the parameter in the call to this method overload is null, compiler overload resolution fails. To unambiguously identify the called method, your code must indicate the type of the null. The following example shows several ways to unambiguously identify this overload.

  code reference: System.String.Split#4

  If the parameter is zero, or the parameter is and the length of this instance is zero, an empty array is returned.

  Each element of defines a separate delimiter that consists of one or more characters. If the parameter is , and two delimiters are adjacent or a delimiter is found at the beginning or end of this instance, the corresponding array element contains .

  If there are more than substrings in this instance, the first minus 1 substrings are returned in the first minus 1 elements of the return value, and the remaining characters in this instance are returned in the last element of the return value.

  If is greater than the number of substrings, the available substrings are returned and no exception is thrown.

  ## The separator array

  If any of the elements in consists of more than a single character, only the first character of that element is considered a delimiter, and any subsequent characters are ignored. For example, if one of the elements in is "10", attempting to split the string "This10is10a10string." returns the following four-element array: { "This", "0is", "0a", "0string." }.

  ## Comparison details

  The method extracts the substrings in this string that are delimited by one or more of the strings in the parameter, and returns those substrings as elements of an array.

  The method looks for delimiters by performing comparisons using case-sensitive ordinal sort rules. For more information about word, string, and ordinal sorts, see the enumeration.

  The method ignores any element of whose value is null or the empty string ("").

  To avoid ambiguous results when strings in have characters in common, the method proceeds from the beginning to the end of the value of the instance, and matches the first element in that is equal to a delimiter in the instance. The order in which substrings are encountered in the instance takes precedence over the order of elements in .

  For example, consider an instance whose value is "abcdef". If the first element in was "ef" and the second element was "bcde", the result of the split operation would be "a" and "f". This is because the substring in the instance, "bcde", is encountered and matches an element in before the substring "f" is encountered.

  However, if the first element of was "bcd" and the second element was "bc", the result of the split operation would be "a" and "ef". This is because "bcd" is the first delimiter in that matches a delimiter in the instance. If the order of the separators was reversed so the first element was "bc" and the second element was "bcd", the result would be "a" and "def".

  ## Performance considerations

  The methods allocate memory for the returned array object and a object for each array element. If your application requires optimal performance or if managing memory allocation is critical in your application, consider using the or method, and optionally the method, to locate a substring within a string.

  If you are splitting a string at a separator character, use the or method to locate a separator character in the string. If you are splitting a string at a separator string, use the or method to locate the first character of the separator string. Then use the method to determine whether the characters after that first character are equal to the remaining characters of the separator string.

  In addition, if the same set of characters is used to split strings in multiple method calls, consider creating a single array and referencing it in each method call. This significantly reduces the additional overhead of each method call.

  Returns a string array that contains the substrings in this string that are delimited by elements of a specified string array. Parameters specify the maximum number of substrings to return and whether to return empty array elements.

  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.

  An array of single-character strings that delimit the substrings in this string, an empty array that contains no delimiters, or null. The maximum number of substrings to return. to omit empty array elements from the array returned; or to include empty array elements in the array returned.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Boolean `` is a null reference.

  This method compares to the substring at the beginning of this instance that is the same length as , and returns an indication whether they are equal. To be equal, must be an empty string (), must be a reference to this same instance, or must match the beginning of this instance.

  This method performs a word (case-sensitive and culture-sensitive) comparison using the current culture.

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

  true if matches the beginning of this string; otherwise, false.

  The string to compare. 0
- Method
  2.0.0.0
  4.0.0.0
  System.Runtime.InteropServices.ComVisible(false)
  System.Boolean `` ``

  The method compares the parameter to the substring at the beginning of this string and returns a value that indicates whether they are equal. To be equal, must be a reference to this same string, must be the empty string (""), or must match the beginning of this string. The type of comparison performed by the method depends on the value of the parameter. The comparison can use the conventions of the current culture ( and ) or the invariant culture ( and ), or it can consist of a character-by-character comparison of code points ( or ). The comparison can also be case-sensitive (, , or ), or it can ignore case (, , ).

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

  true if this instance begins with ; otherwise, false.

  The string to compare. One of the enumeration values that determines how this string and are compared.
- Method
  2.0.0.0
  4.0.0.0
  System.Boolean `` `` ``

  This method compares the parameter to the substring at the beginning of this string that is the same length as , and returns a value that indicates whether they are equal. To be equal, must be an empty string (), must be a reference to this same instance, or must match the beginning of this instance.

  This method performs a comparison using the specified casing and culture.

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

  true if the parameter matches the beginning of this string; otherwise, false.

  The string to compare. true to ignore case during the comparison; otherwise, false. Cultural information that determines how this string and are compared. If is null, the current culture is used.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.String `` is less than zero or greater than the length of the current instance.

  The index is zero-based.

  This method does not modify the value of the current instance. Instead, it returns a new string that begins at the position in the current string.

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

  A string that is equivalent to the substring that begins at in this instance, or if is equal to the length of this instance.

  The zero-based starting character position of a substring in this instance. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.String `` ``

  is greater than the length of the current instance.

  -or-

  or is less than zero.

  is zero-based.

  This method does not modify the value of the current instance. Instead, it returns a new string with characters starting from the position in the current string.

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

  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.

  The zero-based starting character position of a substring in this instance. The number of characters in the substring. 0
- Method
  2.0.0.0
  4.0.0.0
  System.Collections.Generic.IEnumerator<System.Char>

  This method is implemented to support the interface.

  To be added. To be added.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Collections.IEnumerator

  This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. For more information, see the method.

  Returns an enumerator that iterates through the current object.

  An enumerator that can be used to iterate through the current string.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Boolean ``

  This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method.

  For a description of this member, see .

  true if the value of the current string is ; false if the value of the current string is .

  This parameter is ignored.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Byte ``

  This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method.

  For a description of this member, see .

  The converted value of the current object.

  An object that provides culture-specific formatting information.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Char ``

  This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method.

  For a description of this member, see .

  The character at index 0 in the current object.

  An object that provides culture-specific formatting information.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.DateTime ``

  This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method.

  For a description of this member, see .

  The converted value of the current object.

  An object that provides culture-specific formatting information.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Decimal ``

  This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method.

  For a description of this member, see .

  The converted value of the current object.

  An object that provides culture-specific formatting information.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Double ``

  This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method.

  For a description of this member, see .

  The converted value of the current object.

  An object that provides culture-specific formatting information.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int16 ``

  This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method.

  For a description of this member, see .

  The converted value of the current object.

  An object that provides culture-specific formatting information.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 ``

  This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method.

  For a description of this member, see .

  The converted value of the current object.

  An object that provides culture-specific formatting information.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int64 ``

  This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method.

  For a description of this member, see .

  The converted value of the current object.

  An object that provides culture-specific formatting information.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.SByte ``

  This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method.

  For a description of this member, see .

  The converted value of the current object.

  An object that provides culture-specific formatting information.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Single ``

  This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method.

  For a description of this member, see .

  The converted value of the current object.

  An object that provides culture-specific formatting information.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Object `` `` To be added.

  This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method.

  For a description of this member, see .

  The converted value of the current object.

  An object that provides culture-specific formatting information.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.UInt16 ``

  This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method.

  For a description of this member, see .

  The converted value of the current object.

  An object that provides culture-specific formatting information.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.UInt32 ``

  This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method.

  For a description of this member, see .

  The converted value of the current object.

  An object that provides culture-specific formatting information.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.UInt64 ``

  This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. The recommended alternative is to call the method.

  For a description of this member, see .

  The converted value of the current object.

  An object that provides culture-specific formatting information.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Char[] To be added.

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

  A Unicode character array whose elements are the individual characters of this instance. If this instance is an empty string, the returned array is empty and has a zero length.

  0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Char[] `` ``

  or is less than zero.

  -or-

  plus is greater than the length of the current instance.

  The parameter is zero-based. That is, the index of the first character in the string instance is zero.

  If is zero, the returned array is empty and has a zero length. If this instance is null or an empty string (""), the returned array is empty and has a zero length.

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

  A Unicode character array whose elements are the number of characters in this instance starting from character position .

  The starting position of a substring in this instance. The length of the substring in this instance. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.String

  This method takes into account the casing rules of the current culture.

  This method does not modify the value of the current instance. Instead, it returns a new string in which all characters in the current instance are converted to lowercase.

  ## Security Considerations

  The casing operation that results from calling the method takes the casing conventions of the current culture into account. If you need the lowercase or uppercase version of an operating system identifier, such as a file name, named pipe, or registry key, use the or methods. This produces the same result in every culture (unlike the method) and performs more efficiently.

  Returns a copy of this string converted to lowercase.

  A string in lowercase.

  0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.String ``

  The casing rules of the culture specified by the parameter determine the way the case of the string is changed.

  This method does not modify the value of the current instance. Instead, it returns a new string in which all characters in the current instance are converted to lowercase.

  ## Security Considerations

  If you pass the method a object other than , the casing operation will take culture-specific rules into account. If you need the lowercase or uppercase version of an operating system identifier, such as a file name, named pipe, or registry key, use the or method. This produces the same result in every culture and performs more efficiently.

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

  The lowercase equivalent of the current string.

  An object that supplies culture-specific casing rules.
- Method
  2.0.0.0
  4.0.0.0
  System.String

  The invariant culture represents a culture that is culture-insensitive. It is associated with the English language but not with a specific country or region. For more information, see Using the InvariantCulture Property.

  If your application depends on the case of a string changing in a predictable way that is unaffected by the current culture, use the method. The method is equivalent to ToLower(CultureInfo.InvariantCulture). The method is recommended when a collection of strings must appear in a predictable order in a user interface control.

  This method does not modify the value of the current instance. Instead, it returns a new string in which all characters in the current instance are converted to lowercase.

  ## Security Considerations

  If you need the lowercase or uppercase version of an operating system identifier, such as a file name, named pipe, or registry key, use the or methods.

  Returns a copy of this object converted to lowercase using the casing rules of the invariant culture.

  The lowercase equivalent of the current string.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.String

  This method overrides .

  Returns this instance of ; no actual conversion is performed.

  The current string.

  0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.String ``

  is reserved, and does not currently participate in this operation.

  Returns this instance of ; no actual conversion is performed.

  The current string.

  (Reserved) An object that supplies culture-specific formatting information. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.String

  This method uses the casing rules of the current culture to convert each character in the current instance to its uppercase equivalent. If a character does not have an uppercase equivalent, it is included unchanged in the returned string.

  This method does not modify the value of the current instance. Instead, it returns a new string in which all characters in the current instance are converted to uppercase.

  The method is often used to convert a string to uppercase so that it can be used in a case-insensitive comparison. A better method to perform case-insensitive comparison is to call a string comparison method that has a parameter whose value you set to for a culture-sensitive, case-insensitive comparison.

  ## Security Considerations

  The casing operation that results from calling the method takes the casing conventions of the current culture into account. If you need the lowercase or uppercase version of an operating system identifier, such as a file name, named pipe, or registry key, use the or method. This produces the same result in every culture (unlike the method) and performs more efficiently.

  Returns a copy of this string converted to uppercase.

  The uppercase equivalent of the current string.

  0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.String ``

  The casing rules of the culture specified by the parameter determine the way the case of a string is changed.

  This method does not modify the value of the current instance. Instead, it returns a new string in which all characters in the current instance are converted to uppercase.

  ## Security Considerations

  If you pass the method a object other than , the casing operation will take culture-specific rules into account. If you need the lowercase or uppercase version of an operating system identifier, such as a file name, named pipe, or registry key, use the or method. This produces the same result in every culture and performs more efficiently.

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

  The uppercase equivalent of the current string.

  An object that supplies culture-specific casing rules.
- Method
  2.0.0.0
  4.0.0.0
  System.String

  The invariant culture represents a culture that is culture-insensitive. It is associated with the English language but not with a specific country or region. For more information, see Using the InvariantCulture Property.

  If your application depends on the case of a string changing in a predictable way that is unaffected by the current culture, use the method. The method is equivalent to ToUpper(CultureInfo.InvariantCulture). The method is recommended when a collection of strings must appear in a predictable order in a user interface control.

  This method does not modify the value of the current instance. Instead, it returns a new string in which all characters in the current instance are converted to uppercase.

  ## Security Considerations

  If you need the lowercase or uppercase version of an operating system identifier, such as a file name, named pipe, or registry key, use the or methods.

  Returns a copy of this object converted to uppercase using the casing rules of the invariant culture.

  The uppercase equivalent of the current string.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.String

  The method removes from the current string all leading and trailing white-space characters. Each leading and trailing trim operation stops when a non-white-space character is encountered. For example, if the current string is " abc xyz ", the method returns "abc xyz".

  This method does not modify the value of the current instance. Instead, it returns a new string in which all leading and trailing white space characters found in the current instance are removed.

  If the current string equals or all the characters in the current instance consist of white-space characters, the method returns .

  White-space characters are defined by the Unicode standard. The method removes any leading and trailing characters that produce a return value of true when they are passed to the method.

  Removes all leading and trailing white-space characters from the current object.

  The string that remains after all white-space characters are removed from the start and end of the current string.

  0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.String `System.ParamArray`

  The method removes from the current string all leading and trailing characters that are in the parameter. Each leading and trailing trim operation stops when a character that is not in is encountered. For example, if the current string is "123abc456xyz789" and contains the digits from "1" through "9", the method returns "abc456xyz".

  This method does not modify the value of the current instance. Instead, it returns a new string in which all leading and trailing characters found in the current instance are removed.

  If the current string equals or all the characters in the current instance consist of characters in the array, the method returns .

  If is null or an empty array, this method removes any leading or trailing characters that result in the method returning true when they are passed to the method,

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

  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 null or an empty array, white-space characters are removed instead.

  An array of Unicode characters to remove, or null. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.String `System.ParamArray`

  The method removes from the current string all trailing characters that are in the parameter. The trim operation stops when the first character that is not in is encountered at the end of the string. For example, if the current string is "123abc456xyz789" and contains the digits from "1" through "9", the method returns "123abc456xyz".

  This method does not modify the value of the current instance. Instead, it returns a new string in which all trailing characters found in are removed from the current string.

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

  The string that remains after all occurrences of the characters in the parameter are removed from the end of the current string. If is null or an empty array, Unicode white-space characters are removed instead.

  An array of Unicode characters to remove, or null. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.String `System.ParamArray`

  The method removes from the current string all leading characters that are in the parameter. The trim operation stops when a character that is not in is encountered. For example, if the current string is "123abc456xyz789" and contains the digits from "1" through "9", the method returns "abc456xyz789".

  This method does not modify the value of the current instance. Instead, it returns a new string in which all leading white space characters found in the current instance are removed.

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

  The string that remains after all occurrences of characters in the parameter are removed from the start of the current string. If is null or an empty array, white-space characters are removed instead.

  An array of Unicode characters to remove, or null. 0
0