1.去除字符串中的空格
12 3 4 5
1 $('.input').keydown(function () {2 var v = $('.input').val();3 console.log(v);4 //TODO: trim5 v = v.replace(/\s/g, '');6 $('.pre').text(v);7 })
本文共 285 字,大约阅读时间需要 1 分钟。
1.去除字符串中的空格
12 3 4 5
1 $('.input').keydown(function () {2 var v = $('.input').val();3 console.log(v);4 //TODO: trim5 v = v.replace(/\s/g, '');6 $('.pre').text(v);7 })
转载于:https://www.cnblogs.com/margarita/p/5443227.html