PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
StringSplit (Function)
In French: ChaîneDécoupe
Extracts all the sub-strings from a character string according to a one or more string separators.
Example
// 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 by using different separators between each sub-string
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 according to one or more separators Hide the details

<Result> = StringSplit(<Initial String> [, <Separator> [, <Options>]])
<Result>: Array of strings
Array containing the different sub-strings found between the separators.
<Initial String>: Character string (with quotes)
String to split (up to 2 GB).
<Separator>: Optional character string (with quotes)
Corresponds to:
  • The string used to delimit the sub-strings. This string is not included in the result. This separator is case sensitive.
  • An array of strings. The different strings found in the array are used to delimit the sub-strings. 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 sub-strings in the array containing the result:
ccUpCaseConverts the character string into uppercase characters (including the accented characters).
ccLowCaseConverts the character string into lowercase characters.
ccNormal
(default value)
No formatting is performed.
ccIgnoreAccentConverts the accented characters into non-accented characters.
ccIgnoreSpaceDeletes the following characters at the beginning and at the end of string:
  • space (character 32)
  • tabulation (character 9)
  • carriage return (character 13)
  • line break (character 10)
  • control characters 11 and 12
ccIgnorePonctuationAndSpaceRemoves the punctuation and the space characters.

Splitting a character string by using different separators for each sub-string Hide the details

<Result> = StringSplit(<Initial String>, <Separator 1>, <Separator 2> [, ... <Separator N>] [, <Options>])
<Result>: Array of character strings
Array containing the different sub-strings found between the separators.
<Initial String>: Character string (with quotes)
String to split (up to 2 GB).
<Separator 1>: Character string (with quotes)
Separator of sub-strings with subscript 1 and 2. This string is not included in the result. This separator is case sensitive.
<Separator 2>: Character string (with quotes)
Separator of sub-strings with subscript 2 and 3. This string is not included in the result. This separator is case sensitive.
<Separator N>: Character string (with quotes)
Separator of sub-strings with subscript N-1 and N. This string is not included in the result. This separator is case sensitive.
<Options>: Optional Integer constant
Options for formatting sub-strings in the array containing the result:
ccUpCaseConverts the character string into uppercase characters (including the accented characters).
ccLowCaseConverts the character string into lowercase characters.
ccNormal
(default value)
No formatting is performed.
ccIgnoreAccentConverts the accented characters into non-accented characters.
ccIgnoreSpaceDeletes the following characters at the beginning and at the end of string:
  • space (character 32)
  • tabulation (character 9)
  • carriage return (character 13)
  • line break (character 10)
  • control characters 11 and 12
ccIgnorePonctuationAndSpaceRemoves the punctuation and the space characters.
Components
WINDEVWEBDEV - Server codeReports and Queries wd230vm.dll
Windows Mobile wp230vm.dll
Java wd230java.jar
Linux wd230vm.so
Android wd230android.jar
Minimum required version
  • Version 22
This page is also available for…
Comments
Click [Add] to post a comment