Private
Sub
Test_Load(
ByVal
sender
As
System.Object,
ByVal
e
As
System.EventArgs)
Handles
MyBase
.Load
Dim str As String = _
" 中abc中国 "
' 123456stringcountofvb6
' 012345stringcountof.net
Dim str As String = _
" 中abc中国 "
' 123456stringcountofvb6
' 012345stringcountof.net
Label1.Text
=
""
' left
Dim leftStrVB As String = Microsoft.VisualBasic.Left( str , 5 )
Dim leftStr As String = str .Substring( 0 , 5 )
Label1.Text &= " leftStrVBis " & leftStrVB & vbCrLf ' leftStrVBis中abc中
Label1.Text &= " leftStris " & leftStr & vbCrLf ' leftStris中abc中
' center
Dim centerStrVB As String = Microsoft.VisualBasic.Mid( str , 2 , 4 )
Dim centerStr As String = str .Substring( 1 , 4 )
Label1.Text &= " centerStrVBis " & centerStrVB & vbCrLf ' centerStrVBisabc中
Label1.Text &= " centerStris " & centerStr & vbCrLf ' centerStrisabc中
' right
Dim rightStrVB As String = Microsoft.VisualBasic.Right( str , 5 )
Dim rightStr As String = str .Substring( 1 )
Label1.Text &= " rightStrVBis " & rightStrVB & vbCrLf ' rightStrVBisabc中国
Label1.Text &= " rightStris " & rightStr & vbCrLf ' rightStrisabc中国
EndSub
' left
Dim leftStrVB As String = Microsoft.VisualBasic.Left( str , 5 )
Dim leftStr As String = str .Substring( 0 , 5 )
Label1.Text &= " leftStrVBis " & leftStrVB & vbCrLf ' leftStrVBis中abc中
Label1.Text &= " leftStris " & leftStr & vbCrLf ' leftStris中abc中
' center
Dim centerStrVB As String = Microsoft.VisualBasic.Mid( str , 2 , 4 )
Dim centerStr As String = str .Substring( 1 , 4 )
Label1.Text &= " centerStrVBis " & centerStrVB & vbCrLf ' centerStrVBisabc中
Label1.Text &= " centerStris " & centerStr & vbCrLf ' centerStrisabc中
' right
Dim rightStrVB As String = Microsoft.VisualBasic.Right( str , 5 )
Dim rightStr As String = str .Substring( 1 )
Label1.Text &= " rightStrVBis " & rightStrVB & vbCrLf ' rightStrVBisabc中国
Label1.Text &= " rightStris " & rightStr & vbCrLf ' rightStrisabc中国
EndSub