What is the best way to trim() in javascript

前端 未结 19 1966
眼角桃花
眼角桃花 2020-11-29 06:32

The question says it all; JS doesn\'t seem to have a native trim() method.

19条回答
  •  难免孤独
    2020-11-29 06:49

    I know this question is ancient but now, Javascript actually does have a native .trim()

    https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/Trim

提交回复
热议问题