原帖由 goodhermit95 于 2009-8-25 10:02 PM 发表
1 - 10吧
这个不简单
dim strtext as string = textbox1.text
for i as integer = 48 to 90
strtext = strtext.replace(chr(i),"")
next
if strtext.length = 0 then
msgbox("wheeee",information)
...
原帖由 goodhermit95 于 2009-8-25 10:08 PM 发表
regular expression比较快
可是我不会
但是这类型的regular expression 的 format 最容易了
用regular expression的话……
1->设regular expression format 1-10 a-z A-Z
2->If Then Else探测是否符合
...
alert(/^[a-zA-Z0-9]+$/.test("SuperTomato")?"Valid":"Invalid");
String answer;
while(answer.equalsIgnoreCase("[a-zA-z]||[0-9]")){ }
var myRegExp = /[A-Z][0-9]/;
原帖由 goodhermit95 于 2009-8-25 10:53 PM 发表
我记得……好像是这样……
好像可以一行
之前要import system.text.regularexpression
dim re as new regexp
if re.ismatch(textbox1.text,"A-Za-z0.9") then
end if
em0023
alert("Super-Tomato _!@#$%^&*()-=+".replace(/[^a-zA-Z 0-9]+/g, ""));
var str = "Super-Tomato _!@#$%^&*()-=+";
var exp = /[^a-zA-Z 0-9]+/g;
str = str.replace(exp, ""); //把符合的 pattern 替換為無任何文字
alert(str);
原帖由 goodday 于 2009-8-26 11:43 AM 发表
今天给你分超多
:)
Public Function OnlyazAZ09(ByVal text As String) As Boolean
Dim Rtn As Boolean = False
'add at 2003-05-20
'Dim AllowCase As String() = ...
欢迎光临 JBTALKS.CC (https://www.jbtalks.cc/) | Powered by Discuz! X2.5 |