|
|
|
|
|
StringDeleteDuplicate (Function) In french: ChaineSupprimeDoublon Removes duplicates among substrings of a string, based on one or more separators. // Removes duplicates StringDeleteDuplicate("France, Italy, Germany, Spain, France", ", ") // Returns "France, Italy, Germany, Spain"
Syntax
<Result> = StringDeleteDuplicate(<Initial string> , <Separator> [, <Comparison>])
<Result>: Character string String without duplicates. <Initial string>: Character string String with duplicates. <Separator>: String or array of strings This parameter can correspond to:- The string that separates the substrings. This separator is case sensitive.
- An array of strings. The different strings in the array delimit the substrings. These separators are case sensitive.
If this parameter is not specified, the default separator is TAB. <Comparison>: Optional integer Comparison options:
| | ccIgnoreAccent | Accent-insensitive comparison | ccIgnoreCase | Case-insensitive comparison. | ccIgnoreInsideSpace | Comparison ignoring spaces within strings. | ccIgnorePunctuationAndSpace | Space and punctuation-insensitive comparison. | ccIgnoreSpace | Comparison ignoring spaces before and after strings. | ccNormal (Default value) | Standard comparison, equivalent to the '=' operator. |
Remarks - In case of duplicates, only the first occurrence of the substring from the original string is kept in the result string.
- The characters taken into account for punctuation and spaces are provided by the system. To get the list of these characters, write the following WLanguage code:
s is string FOR i = 0 TO 255 IF Charact(i) <> StringFormat(Charact(i), ccIgnorePunctuationAndSpace) THEN Â s += Charact(i) END END Info(s) ToClipboard(s)
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|