jQuery.trim()
来源:互联网 发布:食品安全专业出国 知乎 编辑:程序博客网 时间:2024/05/18 01:49
jQuery.trim( str )Returns: String
Description: Remove the whitespace from the beginning and end of a string.
version added: 1.0jQuery.trim( str )
strThe string to trim.
The $.trim()
function removes all newlines, spaces (including non-breaking spaces), and tabs from the beginning and end of the supplied string. If these whitespace characters occur in the middle of the string, they are preserved.
Examples:
Example: Remove the two white spaces at the start and at the end of the string.
<!DOCTYPE html> <html> <head> <script src="http://code.jquery.com/jquery-latest.js"></script> </head> <body> <pre id="original"></pre> <pre id="trimmed"></pre> <script> var str = " lots of spaces before and after "; $("#original").html("Original String: '" + str + "'"); $("#trimmed").html("$.trim()'ed: '" + $.trim(str) + "'"); </script> </body> </html>
Example: Remove the two white spaces at the start and at the end of the string.
$.trim(" hello, how are you? ");
Result:
"hello, how are you?"
- jQuery trim
- jQuery.trim()
- jquery trim() ie6 firefox3
- jquery----trim方法
- jquery 中的trim()用法
- jquery trim() 功能源代码
- jquery 中$.trim()是什么意思?
- jquery $.trim() 用法
- jQuery.trim(str)
- jQuery.trim( str )
- jQuery.trim() 函数详解
- jquery $.trim()方法
- JQuery的工具trim()
- jquery $.trim()方法
- 笔记 jquery.trim()
- jQuery.trim()方法
- jquery ie7下trim()出错
- 【jQuery】字符串操作函数trim
- Linux配置Spatial Data Server的WebServer(Weblogic)
- c++获取本机的MAC地址
- 青蛙的约会——欧几里得—数论
- gcc中用于预编译的宏(如__cplusplus , __func__ , __FILE__ , __LINE__ 等)
- Android编程之图片加载类
- jQuery.trim()
- Powerbag移动电源背包 走到哪充到哪
- android内存溢出OutOfMemeory (OOM)
- statspack安装使用 和 report 分析 (转自tianlesoftware的博客)
- log 的用法
- 搭建nfs服务器
- servlet总体概况学习
- 写Makefile粗心的后果
- 滑动菜单SlidingMenu实例