您的位置:程序门 -> delphi -> 语言基础/算法/系统设计



如何去掉一个字符串后的制表符,就像用trim()去掉前后空格一样,在线等


[收藏此页] [打印本页]选择字色:背景色:字体:[][][]


如何去掉一个字符串后的制表符,就像用trim()去掉前后空格一样,在线等[已结贴,结贴人:huangwenhuan]
发表于:2007-07-06 13:58:01 楼主
现在一个字符串前后有制表符(如#9,#d,#a等),怎么样去掉呀
发表于:2007-07-06 14:17:091楼 得分:10
用   trimright   函数:

trimright   routine
 
trims   trailing   spaces   and   control   characters   from   a   string.
 
unit  
sysutils  

syntax  


[delphi]   function   trimright(const   s:   string):   string;   overload;


[delphi]   function   trimright(const   s:   widestring):   widestring;   overload;


description  
trimright   returns   a   copy   of   the   string   s   with   trailing   spaces   and   control   characters   removed.
发表于:2007-07-06 14:29:122楼 得分:10
strreplace   也行吧
发表于:2007-07-06 14:38:143楼 得分:0
trimright也能去掉#9,#d,#a之类的吗?
发表于:2007-07-06 14:45:564楼 得分:0
好了,原来可以,谢谢大家
发表于:2007-07-06 16:58:115楼 得分:0
trimright   returns   a   copy   of   the   string   s   with   trailing   spaces   and   control   characters   removed

----

  什么叫“spaces   and   control   characters”,   ascii   小于等于空格(32)的都是。
发表于:2007-07-06 17:10:436楼 得分:0
原来是这样呀,我还以为只能去掉空格


快速检索

最新资讯
热门点击