Skip to content

rightTrim

rightTrim(string) → string · String

Remove whitespace from the RIGHT (end) of a string only.

  • string (required): the string to trim
utlx
rightTrim("   hello   ")                 // "   hello"

Also: normalizeSpace(string) — trims AND collapses internal whitespace to single spaces.

Released under AGPL-3.0.