String. split method (string[], stringsplitoptions) (system)

Delimiter strings are not included in the elements of the returned array. Msci eafe small cap index For example, if the separator array includes the string “–” and the value of the current string instance is “aa–bb-cc”, the method returns an array that contains three elements: “aa”, “bb”, and “cc”.

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

Each element of separator defines a separate delimiter that consists of one or more characters.


Msci world real estate index If the options argument is None, and two delimiters are adjacent or a delimiter is found at the beginning or end of this instance, the corresponding array element contains String .Empty. Msci world esg index For example, if separator includes two elements, “-” and “_”, the value of the string instance is “-_aa-_”, and the value of the options argument is None, the method returns a sting array with the following five elements:

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

The Split method looks for delimiters by performing comparisons using case-sensitive ordinal sort rules. Msci world index bloomberg For more information about word, string, and ordinal sorts, see the System.Globalization .CompareOptions enumeration.

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

For example, consider an instance whose value is “abcdef”. Msci index list If the first element in separator was “ef” and the second element was “bcde”, the result of the split operation would be a string array that contains two elements, “a” and “f”. Msci currency index This is because the substring in the instance, “bcde”, is encountered and matches an element in separator before the substring “f” is encountered.

However, if the first element of separator was “bcd” and the second element was “bc”, the result of the split operation would be a string array that contains two elements, “a” and “ef”. Msci chicago This is because “bcd” is the first delimiter in separator that matches a delimiter in the instance. What is msci eafe 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 string array that contains two elements, “a” and “def”.

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

If you are splitting a string at a separator character, use the IndexOf or IndexOfAny method to locate a separator character in the string. Msci brazil If you are splitting a string at a separator string, use the IndexOf or IndexOfAny method to locate the first character of the separator string. What does msci stand for Then use the Compare 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 Split method calls, consider creating a single array and referencing it in each method call. Msci etf list This significantly reduces the additional overhead of each method call.