XXDAFDA3A1
DFDASFD20B
DFDAF220
DAF12X
A111
结果:
3A1
20B
220
12X
111
我如何取到最后3位字符串呢?有什么公用函数可以直接取得呢?
17 个解决方案
#1
left(字符串,3)
#2
str.Substring(str.Length - 3, 3)
#3
string str="";
str=str.Substring(str.Length - 3, 3)
str=str.Substring(str.Length - 3, 3)
#4
substring可以,貌似不用再指定长度了
str.Substring(str.Length - 3),试试看
str.Substring(str.Length - 3),试试看
#5
vb.net中好像有right函数吧,不行的话就用substring函数喽
#6
Dim xC As String = "XXDAFDA3A1"
xC = Strings.Right(xC, 3)
xC = Strings.Right(xC, 3)
#7
right(XXDAFDA3A1,3) -> 3A1
right(DFDASFD20B,3) -> 20B
right(DFDAF220,3) -> 220
right(DAF12X,3) -> 12X
right(A111,3) -> 3A1
#8
最后一个打错了
#9
Dim tag As String = "XXDAFDA3A1"
Dim result As String = ""
result = Microsoft.VisualBasic.Right(tag, 3)
MsgBox(result)
Dim result As String = ""
result = Microsoft.VisualBasic.Right(tag, 3)
MsgBox(result)
#10
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim str As String = "XXDAFDA3A"
Me.Text = str.Substring(str.Length - 3, 3)'这里是以窗体标题来显示的
End Sub
Dim str As String = "XXDAFDA3A"
Me.Text = str.Substring(str.Length - 3, 3)'这里是以窗体标题来显示的
End Sub
#11
str.Substring(str.Length - 3),
#12
Dim TestString As String = "Hello World!"
Dim subString As String = Microsoft.VisualBasic.Right(TestString, 6)
' Returns "World!".
Dim subString As String = Microsoft.VisualBasic.Right(TestString, 6)
' Returns "World!".
#13
都那么多回答的了,还不结贴?
#14
LEFT,RIGHT,MID,SUBTRING
爱用谁用谁
爱用谁用谁
#15
math.right()
#16
前面几楼的貌似都可以。
#17
看样子烂尾楼了,诶~~~
#1
left(字符串,3)
#2
str.Substring(str.Length - 3, 3)
#3
string str="";
str=str.Substring(str.Length - 3, 3)
str=str.Substring(str.Length - 3, 3)
#4
substring可以,貌似不用再指定长度了
str.Substring(str.Length - 3),试试看
str.Substring(str.Length - 3),试试看
#5
vb.net中好像有right函数吧,不行的话就用substring函数喽
#6
Dim xC As String = "XXDAFDA3A1"
xC = Strings.Right(xC, 3)
xC = Strings.Right(xC, 3)
#7
right(XXDAFDA3A1,3) -> 3A1
right(DFDASFD20B,3) -> 20B
right(DFDAF220,3) -> 220
right(DAF12X,3) -> 12X
right(A111,3) -> 3A1
#8
最后一个打错了
#9
Dim tag As String = "XXDAFDA3A1"
Dim result As String = ""
result = Microsoft.VisualBasic.Right(tag, 3)
MsgBox(result)
Dim result As String = ""
result = Microsoft.VisualBasic.Right(tag, 3)
MsgBox(result)
#10
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim str As String = "XXDAFDA3A"
Me.Text = str.Substring(str.Length - 3, 3)'这里是以窗体标题来显示的
End Sub
Dim str As String = "XXDAFDA3A"
Me.Text = str.Substring(str.Length - 3, 3)'这里是以窗体标题来显示的
End Sub
#11
str.Substring(str.Length - 3),
#12
Dim TestString As String = "Hello World!"
Dim subString As String = Microsoft.VisualBasic.Right(TestString, 6)
' Returns "World!".
Dim subString As String = Microsoft.VisualBasic.Right(TestString, 6)
' Returns "World!".
#13
都那么多回答的了,还不结贴?
#14
LEFT,RIGHT,MID,SUBTRING
爱用谁用谁
爱用谁用谁
#15
math.right()
#16
前面几楼的貌似都可以。
#17
看样子烂尾楼了,诶~~~