You have been redirected from an outdated version of the article. Below is the content available on this topic. To view the old article click here.

clean()

Usage

clean(string)

Description
This method can be used to convert complex strings (e.g. user names, article titles, etc.) into simple strings that can be used in URLs etc.

Characters Action
Whitespace Replace with-
 –'+/|\` Replace with-
Uppercase letters Replace with corresponding lowercase letter
<>.?(){}[]!, Remove

Note

Example

${clean('This is an example string')}
${clean('Süperpöwer')}

results in

this-is-an-example-string
superpower

Search results for "clean()"

clean()

This method can be used to convert complex strings or collections of strings (e.g. user names, article titles, etc.) into simple strings that can be used in URLs etc.

Characters Action
Whitespace Replace with - (consecutive whitespaces are replaced with a single -)
–'+/|\ Replace with -
Uppercase letters Replace with corresponding lowercase letter
<>.?(){}[]!, Remove
clean(string)
clean(collection)