EXAMPLE - String Cleanup Functions

The following example demonstrates functions that can be used to clean up strings. These functions include the following:


In the following (space) and (tab) indicate space keys and tabs, respectively. Carriage return and newline characters are also supported by whitespace functions.

String01this source(space)(space)
String02(tab)(tab)this source
String03(tab)(tab)this source(space)(space)
String04this source's?
String05Why, you @#$%^&*()!
String06this söurce
String07(space)this söurce
String08à mañana


The following transforms generate new columns using each of the string cleanup functions:

derive value: TRIM(source) as: 'trim_source'

derive value: REMOVEWHITESPACE(source) as: 'removewhitespace_source'

derive value: REMOVESYMBOLS(source) as: 'removesymbols_source'


String01this source(space)(space) this source(space)(space) thissourcethis source
String02(tab)(tab)this source(tab)(tab)this sourcethissourcethis source
String03(tab)(tab)this source(space)(space)(tab)(tab)this source(space)(space)thissourcethis source
String04this source's?this sourcesthissource's?this source's?
String05Why, you @#$%^&*()!Why you Why,you@#$%^&*()!Why, you @#$%^&*()!
String06this söurcethis surcethissöurcethis söurce
String07(space)this söurce(space)this surcethissöurcethis söurce
String08à mañana maanaà ma ñanaà ma ñana

Send feedback about...

Google Cloud Dataprep Documentation