StringSplit (Function) In french: ChaîneDécoupe Extracts all the substrings from a character string based on one or more string separators. Versions 25 and later New in version 25
// 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 (with quotes) String to split (up to 2 GB). <Separator>: Optional character string (with quotes) 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:
| | ccUpCase | Converts the string to uppercase characters (including accented characters). | ccLowCase | Converts the string to lowercase characters. | ccNormal (default value) | No formatting is performed. | ccIgnoreAccent | Converts accented characters to non-accented 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
| ccIgnorePunctuationAndSpace | Removes spaces and punctuation 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 (with quotes) String to split (up to 2 GB). <Separator 1>: Character string (with quotes) 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 (with quotes) 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 (with quotes) 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 Business / UI classification : Neutral code
This page is also available for…
|
|
|
| |
| | https://youtu.be/_ow6M_xDIT0
https://windevdesenvolvimento.blogspot.com/2019/05/dicas-2115-windev-webdev-mobile-string.html
// btn_stringsplit
sESTADOS_BRASIL is string="" sESTADOS_BRASIL="AC|AL|AM|AP|BA|CE|ES|EX|GO|MA|MG|MS|MT|PA|PB|PE|PI|PR|RJ|RN|RO|RR|RS|SC|SE|SP|TO" arrARRAY_ESTADOS_BRASIL is array of strings arrARRAY_ESTADOS_BRASIL=StringSplit(sESTADOS_BRASIL,"|") TableDeleteAll(TABLE_ESTADOS) nQUANTIDADE_TOTAL is int=ArrayCount(arrARRAY_ESTADOS_BRASIL) FOR NPOSICAO = 1 TO nQUANTIDADE_TOTAL TableAddLine(TABLE_ESTADOS,arrARRAY_ESTADOS_BRASIL[NPOSICAO]) END
|
|
|
|
| |
| |
| |
| |
| |
| |
| | |
|