xtd 0.2.0
Loading...
Searching...
No Matches

◆ split() [5/5]

std::vector< ustring > xtd::ustring::split ( const std::vector< value_type > &  separators,
size_t  count 
) const
noexcept

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

Parameters
separatorsA character array that delimits the substrings in this string, an empty array that contains no delimiters.
countThe maximum number of substrings to return.
Remarks
Delimiter characters are not included in the elements of the returned array.
If the specified string does not contain any of the characters in separator, or the count parameter is 1, the returned array consists of a single element that contains the specified string.
If the separator parameter 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 char_t.IsWhiteSpace method.
Each element of separator defines a separate delimiter character. If two delimiters are adjacent, or a delimiter is found at the beginning or end of the specified string, the corresponding array element contains empty string.
If there are more than count substrings in the specified string, the first count minus 1 substrings are returned in the first count minus 1 elements of the return value, and the remaining characters in the specified string are returned in the last element of the return value.