StringSplit (Function) In french: ChaîneDécoupe Extracts all the substrings from a character string based on one or more string separators.
// Split a character string according to a separator sCountry is string = "France, Portugal, Germany, Wales" arrCountry is array of strings arrCountry = StringSplit(sCountry, ", ") // Returns ["France","Portugal","Germany","Wales"]
// Split a character string according to a separator sCountry is string = "France, Portugal, Germany, Wales" sCountry1, sCountry2, sCountry3, sCountry4 are strings // Use the multiple assignment (sCountry1, sCountry2, sCountry3, sCountry4) = StringSplit(sCountry, ", ") // sCountry1 is set to "France", sCountry2 is set to "Portugal", // sCountry3 is set to "Germany", sCountry4 is set to "Wales"
// Split a character string using different separators // between each substring sMenu is string = "Starter Today's special, Dessert" sStarter, sTodaysSpecial, sDessert are strings // Use the multiple assignment (sStarter, sTodaysSpecial, sDessert) = StringSplit(sMenu, " ", ", ") // sStarter is set to "Starter", // sTodaysSpecial is set to "Today's special", // sDessert is set to "Dessert"
Syntax
Splitting a character string based on one or more separators Hide the details
<Result> = StringSplit(<Initial string> [, <Separator> [, <Options>]])
<Result>: Array of strings Array that contains the different substrings delimited by separators. <Initial string>: Character string String to split (up to 2 GB). <Separator>: Optional character string Corresponds to:- The string that delimits the substrings. This string is not included in the result. This separator is case sensitive.
- An array of strings. The different strings in the array delimit the substrings. The separators are not included in the result. These separators are case sensitive.
If this parameter is not specified, the default separator is TAB. <Options>: Optional Integer constant Options for formatting substrings in the array containing the result:
| | ccIgnoreAccent | Converts accented characters to non-accented characters. | ccIgnorePunctuationAndSpace | Removes spaces and punctuation characters. | ccIgnoreSpace | Deletes the following characters at the beginning and at the end of the string:- space (character 32)
- tab (character 9)
- carriage return (character 13)
- line feed (character 10)
- control characters 11 and 12
| ccLowCase | Converts the string to lowercase characters. | ccNormal (default value) | No formatting is performed. | ccUpCase | Converts the string to uppercase characters (including accented characters). |
Splitting a character string by using different separators for each substring Hide the details
<Result> = StringSplit(<Initial string> , <Separator 1> , <Separator 2> ... [, <Separator N>] [, <Options>])
<Result>: Array of character strings Array that contains the different substrings delimited by separators. <Initial string>: Character string String to split (up to 2 GB). <Separator 1>: Character string Separator of substrings at index 1 and 2 in the result array. This string is not included in the result. This separator is case sensitive. <Separator 2>: Character string Separator of substrings at index 2 and 3 in the result array. This string is not included in the result. This separator is case sensitive. <Separator N>: Character string Separator of substrings at index N-1 and N in the result array. This string is not included in the result. This separator is case sensitive. <Options>: Optional Integer constant Options for formatting substrings in the array containing the result:
| | ccIgnoreAccent | Converts accented characters to non-accented characters. | ccIgnorePunctuationAndSpace | Removes spaces and punctuation characters. | ccIgnoreSpace | Deletes the following characters at the beginning and at the end of the string:- space (character 32)
- tab (character 9)
- carriage return (character 13)
- line feed (character 10)
- control characters 11 and 12
| ccLowCase | Converts the string to lowercase characters. | ccNormal (default value) | No formatting is performed. | ccUpCase | Converts the string to uppercase characters (including accented characters). |
Business / UI classification: Neutral code
This page is also available for…
|
|
|
|