口袋社区-Poke The BBS's Archiver

最美我中文 发表于 2008-8-2 16:13

vb-将一串字符中所有中文剔出来

放置两个Text,一个Button


Private Sub Command1_Click()


Dim a As String
For i = 1 To Len(Text1.Text)
a = Mid(Text1.Text, i, 1)
If Asc(a) > 0 Then
If a = Chr(10) Then
Text2.Text = Text2.Text + vbCrLf
End If
a = ""
Text2.Text = Text2.Text + a
Else
Text2.Text = Text2.Text + a
End If
Next
End Sub

Private Sub Form_Load()
Text1.Text = ""
Text2.Text = ""
End Sub

liuyanghejerry 发表于 2008-8-2 18:07

原来是利用ASC码的顺序做文章了……

最美我中文 发表于 2008-8-2 18:48

那是。如果一个汉字一个汉字的判断那就等着死机吧

今天放出那个TMED GSC的时候因为汉化没法把字写全了从口袋吧整全中文汉化时突发奇想想出来的这个小东西

深红喷火龙 发表于 2008-9-11 13:21

汉字asc传回小于零的值吗?[yct38] [yct38]

[[i] 本帖最后由 深红喷火龙 于 2008-9-11 13:22 编辑 [/i]]

cedar_ren 发表于 2008-9-12 16:53

汉字好像没有ASC II.

youd 发表于 2008-9-12 19:22

对,因此如果用ASCII判断汉字,只要表里没有就成

最美我中文 发表于 2008-9-12 21:58

[quote]原帖由 [i]深红喷火龙[/i] 于 2008-9-11 13:21 发表 [url=http://usa.poketb.com/bbs/redirect.php?goto=findpost&pid=89688&ptid=5045][img]http://usa.poketb.com/bbs/images/common/back.gif[/img][/url]
汉字asc传回小于零的值吗?[yct38] [yct38] [/quote]

VB确实是这样的

深红喷火龙 发表于 2008-9-13 16:31

没弄过汉字的,我以为都在256以后的说

最美我中文 发表于 2008-9-15 00:57

不信试试Msgbox Asc("最")

页: [1]

Powered by Discuz! Archiver 6.1.0F  © 2001-2007 Comsenz Inc.