|
Answer» Does anyone know how to GET single characters, or two characters at a TIME(small string), from a string?
ex. Gettting 25 from "version_25"
Thought of the split function but didn't really work...
Thanks everyone!!!! SORRY, this is for Visual Basic 6.0 by the way... i forgot to mention it Dim AnyString, MyStr AnyString = "Hello World" ' Define string. MyStr = Right(AnyString, 1) ' Returns "d". MyStr = Right(AnyString, 6) ' Returns " World". MyStr = Right(AnyString, 20) ' Returns "Hello World".
there is also a "Left" command as well that works the same way, except REVERSED and there is a mid function:
Dim MyString, FirstWord, LastWord, MidWords MyString = "Mid Function Demo" ' Create text string. FirstWord = Mid(MyString, 1, 3) ' Returns "Mid". LastWord = Mid(MyString, 14, 4) ' Returns "Demo". MidWords = Mid(MyString, 5) ' Returns "Function Demo".
|