| 网站首页 | 业界新闻 | 小组 | 交易 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛

已结贴   问题点数：10  回复次数：5

For i = 1 To Len(a)
d = Mid(a, i, 1)
If Asc(d) < 0  Then
c = c & d
ElseIf d = Chr(10) Then
c = c & vbCrLf
End If
Next

i1 = Split(a, vbCrLf)
For i2 = 0 To UBound(i1)
a1 = ""
For i = 1 To Len(i1(i2))
d = Mid(i1(i2), i, 1)
If Asc(d) < 0 Then
a1 = a1 & i & " "
a2 = i
a3 = Split(a1, " ")
End If
Next
b1 = b1 & Mid(i1(i2), a3(0), a2) & vbCrLf
ss = ""
For i3 = 1 To Len(b1)
b2 = Mid(b1, i3, 1)
If Asc(b2) < 0 Or Asc(b2) >= 48 And Asc(b2) <= 57 Then
ss = ss & b2
ElseIf b2 = Chr(10) Then
ss = ss & vbCrLf
End If
Next
Next

[此贴子已经被作者于2018-12-29 20:39编辑过]

得分:5
Private Sub Command1_Click()
Text1.Text = "中asd1231文 1232151" & vbCrLf & "中asd1231文 1232151"
For i = 1 To Len(Text1.Text)
d = Mid(Text1.Text, i, 1)
If Asc(d) < 0 Then
c = c & d
ElseIf d = Chr(10) Then
c = c & vbCrLf
ElseIf d >= Chr(48) And d =< Chr(57) Then'判断数字
c = c & d
End If
Next
Debug.Print c
End Sub
得分:0

[此贴子已经被作者于2018-12-29 11:13编辑过]

得分:5

```Private Sub Command1_Click()
Me.Show
Text1.Text = "中asd1231文 1232151" & vbCrLf & "中asd1231文 1232151"
For i = 1 To Len(Text1.Text)
d = Mid(Text1.Text, i, 1)
If d = Chr(10) Then c = c & vbCrLf: m = m & vbCrLf
If d >= Chr(48) And d <= Chr(57) Then
c = c & d
ElseIf Asc(d) < 0 Then
m = m & d
End If
Next
Print c & vbCrLf & m
End Sub```

得分:0

得分:0

```Private Sub Command1_Click()
Me.Show
Dim AA(1 To 2) As String, c As String, d As String
AA(1) = "中asd1231文 1232151": AA(2) = "中asd4567文 1232151"
AA(1) = Left(AA(1), InStr(1, AA(1), " ", 1)): AA(2) = Left(AA(2), InStr(1, AA(2), " ", 1))
For J = 1 To 2
For I = 1 To Len(AA(J))
d = Mid(AA(J), I, 1)
If d >= Chr(48) And d <= Chr(57) Or Asc(d) < 0 Then
c = c & d
End If
Next I
c = c & vbCrLf
Next J
Print c
End Sub
```

• 6
• 1/1页
• 1