10084.html
来自「VB技巧问答10000例,是一个教程」· HTML 代码 · 共 23 行
HTML
23 行
<html>
<head>
<title>Another solution</title>
</head>
<body bgcolor="#FFFFFF" vlink="#808080">
<center>
<h1>Another solution</h1>
</center>
<hr size=7 width=75%>
<hr size=7 width=75%><p>
Posted by wei on February 12, 1999 at 04:34:13:<p>
In Reply to: <a href="10082.html">Re: vb□拜</a> posted by □狶 on February 11, 1999 at 23:19:58:<p>
: 叫代刚□□□祘Α絏:<br>: 叫□□From□□竚□Text Box ㎝ㄢ□Label<br>: Dim nArr()<br>: Dim i As Long<br>: Dim j As Long<br>: Dim k As Long<br>: Dim l As Long<br>: Dim sStr As String<br>: Dim sVal1 As String<br>: Dim sVal2 As String<br>: Dim cFlag As Boolean<p>: Private Sub Form_Load()<br>: sStr = "1234567890,.1/;':@#$%^*()_+|[]{}" & """" & "&&"<br>: Label2.Caption = sStr<br>: cFlag = False<br>: i = 1<br>: End Sub<p>: Private Sub Label1_Click()<br>: If Text1.Text <> "" Then<br>: For i = 1 To Len(Text1.Text)<br>: sVal1 = Mid(Text1.Text, i, 1)<br>: For j = 1 To Len(sStr)<br>: sVal2 = Mid(sStr, j, 1)<br>: If cFlag = False Then<br>: If sVal2 = sVal1 Then<br>: cFlag = True<br>: Else<br>: cFlag = False<br>: End If<br>: End If<br>: Next j<br>: If cFlag = False Then<br>: ReDim Preserve nArr(k)<br>: nArr(k) = sVal1<br>: k = k + 1<br>: Else<br>: cFlag = False<br>: End If<br>: Next i<br>: sVal1 = ""<br>: For l = 0 To UBound(nArr)<br>: sVal1 = sVal1 & nArr(l)<br>: nArr(l) = ""<br>: Next l<br>: Label1.Caption = sVal1<br>: End If<br>: End Sub<p>: <br>: : 兵ン=璝□﹃皑□s(i)い□1234567890,.1/;'":@#$%^&*()_+|[]{}ㄤいヴ□□<br>: : 痹瓃=□s(i)い□埃□□赣□じ<br>: : □:"string."---->string<br>: : fat!gh ---->fatgh<p>: : ぃ□赣□□粜??<br>: : thanks<p><p>Suppose s[i} is the target string<p>Dim p(34) as string 'Size = number of ilegal char<br>Dim j as integer<br>p[0]="1"<br>p[1]="2"<br>...<br>P[33]=")"<p>for j=0 to 33<br> s[i]=replace(s[i], p[j], "")<br>next j<br>
<br>
<br><hr size=7 width=75%><p>
<a name="followups">Follow Ups:</a><br>
<ul><!--insert: 10084-->
</ul><!--end: 10084-->
<br><hr size=7 width=75%><p>
</body></html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?