jQuery API 返回首页目录 | jQuery API 中英文对照版
$.trim(str)
$.trim(str)

删除字符串两端的空白字符。

返回值:String

参数:

  • str (String): 要删除空白字符的字符串

示例:

$.trim(" hello, how are you? ");

结果:

"hello, how are you?"

 
$.trim( str )

Remove the whitespace from the beginning and end of a string.

Return value: String
Parameters:

  • str (String): The string to trim.

Example:

 $.trim("  hello, how are you?  ");  
Result:
 "hello, how are you?"  
相关链接
asp之家 | jQuery官方网站 | jQuery中文网 | 电子书作者网站 | 电子书作者blog