如何过滤掉TEXT1中字符里的空格!
如何过滤掉TEXT1中字符里的空格!
不管空格在前面还是后面还是中间!
问题点数:20、回复次数:9Top
1 楼skystar2001(波塞冬)回复于 2003-08-03 23:32:19 得分 5
用replace(text1," ","")
第一个双引号之间有个空格,第二个没有~~
你试试看可以吗?Top
2 楼moleboy(薄荷糖)回复于 2003-08-03 23:42:37 得分 0
好像不可以!Top
3 楼rainstormmaster(暴风雨 v2.0)回复于 2003-08-03 23:45:12 得分 0
Option Explicit
Private Sub Command1_Click()
Text1.Text = Replace(Text1.Text, " ", "")
Text1.Text = Replace(Text1.Text, Chr(-24159), "") '替换中文全角空格
End SubTop
4 楼skystar2001(波塞冬)回复于 2003-08-04 09:08:48 得分 0
可以呀~~我试过了有什么问题吗??Top
5 楼skystar2001(波塞冬)回复于 2003-08-04 09:09:42 得分 0
哦确实有楼上的说的那种情况~~~
厉害~~~Top
6 楼didishu0807(虫虫)回复于 2003-08-04 09:14:24 得分 0
去处前导空白 (LTrim)、尾随空白 (RTrim) 或前导和尾随空白 (Trim)。
Top
7 楼didishu0807(虫虫)回复于 2003-08-04 09:14:57 得分 0
aa=trim(text1.text)Top
8 楼mafangsan(mafangsan)回复于 2003-08-04 09:19:08 得分 15
dim s as string
for i=1 to len(text1.text)
if mid(text1.text,i,1)<>" " then
s=s+mid(text1.text,i,1)
endif
next
text1.text=sTop
9 楼hxy2003(asfd)回复于 2003-08-04 12:40:15 得分 0
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 32 Then KeyAscii = 0
End Sub
Top



