syntax:functions:keepchars
This is an old revision of the document!
Table of Contents
KeepChars(text, keep_string)
Category: Text function
Description
This function keeps only the characters given in keep_string and removes the others from text.
Arguments
Argument | Type | Description |
---|---|---|
text | Text | The text value to search within for the after_string string. |
keep_string | Text (must not be empty) | A string of individual characters within text to keep, removing all other characters. |
Return value type: Text
Remarks
This function is case sensitive.
text and keep_string are implicitly converted to text values if required.
The retained characters appear in the result in the order they appear in text.
If none of the characters in keep_string are found, an (empty) value is returned.
Examples
keepchars('a1b2c3', 'abc') = 'abc' keepchars('a1b2c3', 'cba') = 'abc' keepchars('3b2d1', '123') = '321' keepchars('Canada', 'acx') = 'aaa' //'C' not kept due to case mismatch; no 'x' in 'Canada' keepchars('Canada', 'Ca') = 'Caaa' keepchars('Canada', 'zxw') = (empty) //'z', 'x', nor 'w' are found in 'Canada'
See also
syntax/functions/keepchars.1627886229.txt.gz · Last modified: 2021/08/02 02:37 by craigt