Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Published by Scroll Versions from space DEV and version next

D toc

Excerpt

Removes all characters from a string

...

that are not

...

letters, numbers, 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 lang vs sql
 

D s
snippetBasic

Column reference example:

REMOVESYMBOLS
d-codelang-syntax
RawWrangletrue
Typeref
showNotetrue
WrangleTextderive type:single value:
removesymbols(MyName)

removesymbols(MyName)

Output:

...

Returns the value

...

in the MyName column value with all non-alphanumeric characters removed. 

String literal example:

REMOVESYMBOLS
d-codelang-syntax
RawWrangletrue
Typeref
showNotetrue
WrangleTextderive type:single value:
removesymbols('Héllõ, Wõrlds!?!?')

removesymbols('Héllõ, Wõrlds!?!?')

Output:

...

Returns the string: Héllõ Wõrlds

...

.

Wildcard example:

d-

...

lang-syntax
RawWrangletrue
Typeref
showNotetrue
WrangleTextset col:* value:

...

removesymbols($col)

removesymbols($col)

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

D s
snippetSyntax

REMOVESYMBOLS
d-codelang-syntax
RawWrangletrue
Typesyntax
showNotetrue
WrangleTextderive type:single value:
removesymbols(column_string)

removesymbols(column_string)


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

...