Options to configure CleanUpStringParser

interface CleanUpStringParserOptions {
    emptyStringResult?: null | string;
    trim?: boolean | "start" | "end";
    compressWhitespace?: boolean;
    replaceWhitespace?: null | string;
    stripTheseCharacters?: null | string;
    convertCase?: null | "lower" | "upper";
}

Hierarchy (view full)

Properties

emptyStringResult?: null | string

Value to return if the text was only an empty string (after trimming) Defaults to ''. Can be any string or null

trim?: boolean | "start" | "end"

Determines if leading and trailing whitespace is discarded. Defaults to true. Can be 'start' to trim only starting whitespace and 'end' to trim only ending whitespace.

compressWhitespace?: boolean

When true, 2 or more back-to-back whitespaces are replaced by a single whitespace character. This is always run before replaceWhitespace and after stripCharacters, so you can turn: "203 - 533 - (3999)" into 203533(3999) when stripping "-" and using this. Defaults to false.

replaceWhitespace?: null | string

Replaces all whitespace with this string. Does nothing if null. This option is run after compressWhitespace.

stripTheseCharacters?: null | string

Removes any character found in the string. Does nothing if null. This option runs before compressWhitespace and replaceWhitespace.

convertCase?: null | "lower" | "upper"

Convert the case. Supports 'upper' and 'lower'. Does nothing if null.

Generated using TypeDoc v0.25.12