Skip to content

Text.RemoveWeirdChars

Rodrigo Celso de Lima Porto edited this page Jan 13, 2026 · 1 revision

Removes special and non-printable characters from a text, with an option to replace them with spaces.

Syntax

Text.RemoveWeirdChars(
    textToClean as text,
    optional replacer as text
) as text

Parameters

  • textToClean: The text string to be cleaned.
  • replacer (optional): A text string to replace special characters with. If omitted, special characters are replaced by an white space.

Return Value

Returns the cleaned text with special characters either removed or replaced by the specified replacer.

Examples

Example 1: Cleans text with special characters.

Text.RemoveWeirdChars("Hello" & Character.FromNumber(0) & "World!")

Result

"Hello World!"

Example 2: Replaces all weird characters if a replacer is specified.

Text.RemoveWeirdChars("Hello" & Character.FromNumber(0) & "World!", "_")

Result

"Hello_World!"

Clone this wiki locally