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

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

Permalink to Table of ContentsTable 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

Permalink to Quick TakeQuick Take

↑ back to top

Permalink to Include carriage returns in the configured trim setInclude carriage returns in the configured trim set

↑ back to top

Permalink to Trim every JavaScript whitespace characterTrim every JavaScript whitespace character

↑ back to top

Permalink to Trim tabs but preserve ordinary spaces at the edgesTrim tabs but preserve ordinary spaces at the edges

↑ back to top

Permalink to Include line feeds in the configured trim setInclude line feeds in the configured trim set

↑ back to top

Permalink to Preserve non-space whitespace at the trimmed boundariesPreserve non-space whitespace at the trimmed boundaries

↑ back to top

Permalink to Include raw non-breaking spaces in the configured trim setInclude raw non-breaking spaces in the configured trim set

↑ back to top

Permalink to Return an empty ranges array when the value needs no trimmingReturn an empty ranges array when the value needs no trimming

↑ back to top

Permalink to Include tabs in the configured trim setInclude 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