Find character at specific position

pankers

New member
Local time
Today, 14:24
Joined
Sep 20, 2011
Messages
1
I need to find the character at a specified position in a string. This is not the same as finding the position of a character, which is what I mostly found when searching for this answer.

Example:

Dim mystr as String
Dim odds as Integer

mystr = "9998675309"

odds = {character At position 2) + {character at position 5}

The result should be 9 + 6; thus odds = 15.

I can do this in Java, I need to do it in VB.

Thanks,
PA
 
Look into the Mid() and Val() functions. Mid will get you the string at a particular position and Val will return a Number type.
 

Users who are viewing this thread

Back
Top Bottom