Skip to Content
  • Website
Codsen
  • Home
  • Open Source
  • Articles
  • About

backOpen Source→string-trim-spaces-only→Examples

Table of Contents

  • Quick Take
  • Include carriage returns in the configured trim set
  • Trim every JavaScript whitespace character
  • Trim tabs but preserve ordinary spaces at the edges
  • Include line feeds in the configured trim set
  • Preserve non-space whitespace at the trimmed boundaries
  • Include raw non-breaking spaces in the configured trim set
  • Return an empty ranges array when the value needs no trimming
  • Include tabs in the configured trim set
↑ back to top

Quick Take

↑ back to top

Include carriage returns in the configured trim set

↑ back to top

Trim every JavaScript whitespace character

↑ back to top

Trim tabs but preserve ordinary spaces at the edges

↑ back to top

Include line feeds in the configured trim set

↑ back to top

Preserve non-space whitespace at the trimmed boundaries

↑ back to top

Include raw non-breaking spaces in the configured trim set

↑ back to top

Return an empty ranges array when the value needs no trimming

↑ back to top

Include tabs in the configured trim set

↑ back to top
back 

Copyright

All rights reserved © Roy Revelt 2026
All our open source packages are under MIT licenceopens in a new tab

Activities

🐛 See a bug? Raise an issueopens in a new tab
💘 Check out the Indiewebopens in a new tab and Libera manifestoopens in a new tab