當前位置:外匯行情大全網 - 外匯匯率 - 在vb中text1中有"...tasdldjffhhkkghfgy...(表示很多字符)".

在vb中text1中有"...tasdldjffhhkkghfgy...(表示很多字符)".

Private Sub Command1_Click()

Dim a As Long, b As Long, nStr As String

'得到以S開頭的兩個字符:

a = InStr(Text1.Text, "s")

If a > 0 Then

nStr = Mid(Text1.Text, 2)

MsgBox "以S開頭的兩個字符=" & nStr

End If

'得到d和h之間的字符:

a = InStr(Text1.Text, "d")

b = InStr(a + 1, Text1.Text, "h")

If a > 0 And b > 0 Then

nStr = Mid(Text1.Text, a + 1, b - a - 1)

MsgBox "d和h之間的字符=" & nStr

End If

End Sub

  • 上一篇:中海地產和中海宏洋的區別
  • 下一篇:如何畫壹只飛翔老鷹
  • copyright 2024外匯行情大全網