IT KNOWLEDGE

IT KNOWLEDGE
BC

Wednesday, May 21, 2014

Substring (VB.Net)

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"



Please Give Us Your 1 Minute In Sharing This Post!
SOCIALIZE IT →
FOLLOW US →
SHARE IT →
Powered By: itech-9999

0 comments: