Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin

D toc
Excerpt

Removes from a string all characters that are not alpha-numeric, accented Latin characters, or whitespace.

Info

NOTE: Non-Latin letters are also removed.

Tip

Tip: This function also removes common punctuation, such as the following:

Code Block
. , ! & ?

To preserve these characters, you might replace them with an alphanumeric text string. For example, the question mark might be replaced by:

Code Block
zzQUESTIONMARKzz

After the function has been applied, you can replace these strings with the original values.

 

D s
snippetBasic

Column reference example:

D code

derive type:single value:REMOVESYMBOLS(MyName)

Output: The value of the MyName column value with all non-alphanumeric characters removed. 

String literal example:

D code

derive type:single value:REMOVESYMBOLS('Héllõ, Wõrlds!?!?')

Output: The string Héllõ Wõrlds is written to the new column.

Wildcard example:

D code

set col:* value:REMOVESYMBOLS($col)

Output: Strips all non-alphanumeric or space characters from all columns in the dataset.

D s
snippetSyntax

D code

derive type:single value:REMOVESYMBOLS(column_string)

ArgumentRequired?Data TypeDescription
column_stringYstringName of the column or string literal to be applied to the function

D s lang notes

column_string

Name of the column or string constant to be trimmed of symbols.

  • Missing string or column values generate missing string results.
  • String constants must be quoted ('Hello, World').
  • Multiple columns and wildcards are not supported.

D s
snippetusage

Required?Data TypeExample Value
YesString literal or column referencemyColumn

D s
snippetExamples

Example - String cleanup functions together

Include Page
EXAMPLE - String Cleanup Functions
EXAMPLE - String Cleanup Functions

D s also
labelstring