Tinderbox v10 Icon

String.deleteCharacters(characterSet)


Operator Type: 

Operator Scope of Action: 

Operator Purpose: 

Operator First Added: 

Operator in Current Baseline: 

Operator Last Altered: 

 Function  [other Function type actions]

 Item  [operators of similar scope]

 Data manipulation  [other Data manipulation operators]

 v9.0.0

 Baseline

 As at baseline


String.deleteCharacters(characterSet)

Returns a copy of the string from which all instances of every discrete character in the quoted literal string-based set characterSet have been removed. For example:, if $MyString is "1Hello1 2world3";

$MyStringA = $MyString.deleteCharacters("1234567890"); 

would remove any digits from the target string, thus $MyStringA will be "Hello world", having removed two instances of '1', and a single instance of '2' and of '3'.

But were $MyString "Hello world: 45";

$MyStringA = $MyString.deleteCharacters("1234567890"); 

the result would be "Hello world: ". Importantly, note the trailing space as only the digits (i.e. characters in characterSet) have been removed.