...
The following transforms generate new columns using each of the string cleanup functions:
D code |
---|
derive type:single value: TRIM(source) as: 'trim_source' |
D code |
---|
derive type:single value: REMOVEWHITESPACE(source) as: 'removewhitespace_source' |
D code |
---|
derive type:single value: REMOVESYMBOLS(source) as: 'removesymbols_source' |
Results:
Strings | source | removesymbols_source | removewhitespace_source | trim_source |
---|
String01 | this source(space)(space) | this source(space)(space) | thissource | this source |
String02 | (tab)(tab)this source | (tab)(tab)this source | thissource | this source |
String03 | (tab)(tab)this source(space)(space) | (tab)(tab)this source(space)(space) | thissource | this source |
String04 | this source's? | this sources | thissource's? | this source's? |
String05 | "Why, you @#$%^&*()!" | Why you | Why,you@#$%^&*()! | Why, you @#$%^&*()! |
String06 | this |
söurce surcethissöurce söurcesöurce |
String07 | (space)this |
söurce surcethissöurce söurce maana | à ma ñana | à ma ñana