Web platform features explorer

String trimStart() and trimEnd()

The trimStart() and trimEnd() methods of strings return a new string with whitespace removed from the beginning or end of the string.

Status

Baseline Widely Available (since 2022-07-15)

Browser support

  • Chrome 66 Released on 2018-04-17
  • Chrome Android 66 Released on 2018-04-17
  • Edge 79 Released on 2020-01-15
  • Firefox 61 Released on 2018-06-26
  • Firefox for Android 61 Released on 2018-06-26
  • Safari 12 Released on 2018-09-17
  • Safari on iOS 12 Released on 2018-09-17