Description
Remove all JavaScript whitespace characters when removeInternal is true, otherwise trim only the ends.
Text comparison depends on the character policy used. Whitespace changes and Unicode normalization can alter a string even when parts of it look similar. An explicit transformation or status check makes that policy visible without establishing that two identifiers have the same real-world meaning.
Remove all JavaScript whitespace characters when removeInternal is true, otherwise trim only the ends.
When to use this tool
Use Identifier Whitespace Normalization Disclosure when you need to disclose or test the selected character transformation before comparing text.
How to use the tool and how it works
- Enter token, removeInternal. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read normalized, changed, removed. Inspect changed before interpreting the associated values.
Remove all JavaScript whitespace characters when removeInternal is true, otherwise trim only the ends. Return normalized, changed, and removed as the original-minus-result UTF-16 length.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| token | Token | Required. Text; maximum UTF-16 length 8192. |
| removeInternal | Remove Internal | Required. Boolean. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| normalized | Normalized | Required. Text; maximum UTF-16 length 8192. |
| changed | Changed | Required. Boolean. |
| removed | Number of removed UTF-16 code units. | Required. Safe integer. |
{
"input": {
"token": " AB 12 ",
"removeInternal": true
},
"output": {
"normalized": "AB12",
"changed": true,
"removed": 3
}
} Limitations and assumptions
- Removed counts code units, not grapheme clusters, and JavaScript whitespace is the selected character policy. This does not validate an identifier or establish that whitespace removal preserves its meaning.
- The field tables state structural bounds; the mechanics also specify cross-field constraints. Malformed inputs and unsupported domains cause errors. A successful false flag, empty branch value, or zero placeholder has the meaning stated above and is distinct from an input error.
Alternative or Complementary methods
Choose the character policy explicitly before comparing or transforming identifiers. Inspect the original text when normalization or whitespace removal could change its meaning.
References
Similar or alternative tools
- DOI URL Prefix Versus Identifier Tag
Recognize an optional case-insensitive https://doi.org/ or https://dx.doi.org/ resolver prefix.
- IPv6 Zone Identifier Empty Token
Inspect a raw IPv6-zone delimiter without validating the address or decoding a URI percent escape.