VB mid 和 InStr的用法
g的位置 = InStr(InStr(ml, "g") + 1, ml, "g")
从第一个G的后一位开始找!
Private Sub Command1_Click()
Dim ml(3) As String, s As String
If Len(Trim(Text1.Text)) < 15 Then
s = LCase(Text1.Text) & Space(4)
Else
s = LCase(Text1.Text)
End If
For i = 0 To 3
ml(i) = Split(s, " ")(i)
Print ml(i)
Print Trim(Mid(ml(i), 1, 1)) & " : " & Trim(Mid(ml(i), 2, 2))
Next i
'Label1.Caption = Join(ml, ",")
'Label2.Caption = Trim(Mid(ml(0), 2, 3))
'G01 G02 X03 Y04
End Sub
标签:VB,mid,InStr
版权声明:文章由 酷百书 整理收集,来源于互联网或者用户投稿,如有侵权,请联系我们,我们会立即处理。如转载请保留本文链接:https://www.kubaishu.com/article/117124.html