全部版块 我的主页
论坛 提问 悬赏 求职 新闻 读书 功能一区 学习笔记1.0
25751 4
2011-01-11
trim(),  来删除字符串 之后的 空格
strip() 函数 来删除字符串 之前和之后的 空格


但此类函数并不能处理字符串中间的空格。更多功能可以用compress

trim() – 去掉字符串尾部空格,如果字符串为空,则返回一个空格left() – 把字符串开头的空格移到尾部strip() – 去掉字符串开头和结尾的所有空格

Removes leading and trailing spaces from a string, returning
an empty string (‘’) if str is blank.

Assigning the result to a variable
doesn’t affect the variable’s length;
if necessary, strip
pads the result with new trailing spaces to match the target
variable’s length.

The result’s default length is the length of str.

strip is useful for removing trailing spaces during concatepostal
nation.

strip() is equivalent to trimn(left()) but runs faster.
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2011-1-11 12:00:26
•cat() – 连接字符串,与连接符作用类似,保留首尾全部空格
•catt() – 连接字符串,但是连接之前会去掉各字符串尾部空格,相当于连接符结合trim()使用
•cats() – 连接字符串,但是连接之前会去掉首尾全部空格,相当于连接符结合strip()使用
•catx() – 连接字符串,但是连接之前会去掉首尾全部空格,并且在字符串之间加上一个指定的字符串
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2014-1-25 10:48:22
学习了 谢谢分享
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2017-11-15 12:05:57
谢谢分享
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2018-2-27 10:23:36
很好的总结啊
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群