注意空格!
$.trim(string1) == $.trim(string2)
------------------------------------------------------------------------
去掉字符串起始和结尾的空格: jQuery.trim(str);
jQuery 代码:
$.trim(" hello, how are you? ");
结果:
"hello, how are you?"
时间: 2024-10-16 15:05:13
注意空格!
$.trim(string1) == $.trim(string2)
------------------------------------------------------------------------
去掉字符串起始和结尾的空格: jQuery.trim(str);
$.trim(" hello, how are you? ");
"hello, how are you?"