Parsing A Few Characters in A String – VB.Net

If you need to parse just a few characters from a string, you can easily do that in the code-behind like this:

MyVariable = VariableName.Substring(1,3)

This gets the first through the third character in the string and places it in MyVariable. Note that the starting position of the variable is 0 so the true first characters would be picked up if you used VariableName.Substring(0,3).


Tags: , ,

Leave a Comment

Spam protection by WP Captcha-Free