Substring use to retrieve string from specific position. For example we would like to retrieve start from character 7th and get 10 characters which write Substring(7,10). Note substring count space as one character too.
Dim Str As String = "I would like a cup of milk coffee"
Str = Str.Substring(8, 10)
MsgBox(Str)
- As you see here
- whole string = 33 characters(include space)
- 8(cut 8 characters out) = "I_would_"
- 10(get 10 characters) = "like_a_cup"
0 comments:
Post a Comment