strings in vb
Author |
Message |
Homer_simpson
![](http://compsci.ca/v3/uploads/user_avatars/18138546704b4d2a3b2e50e.gif)
|
Posted: Sun Nov 09, 2003 2:34 pm Post subject: strings in vb |
|
|
say i got this string:
s="jackass"
how can i make it print the third character "c"
i tried print s(3) but it doesn't work like that =( |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
Tony
![](http://wiki.compsci.ca/images/f/f4/OniTony.gif)
|
Posted: Sun Nov 09, 2003 3:16 pm Post subject: (No subject) |
|
|
well, to use substrings in VB, you can use Mid(from:int, length:int)
so 3rd character would be
Mid(3,1)
Now the string itself also probably goes somewhere... but since I don't currently have VB installed, I can't say for sure.
There're also Left() and Right() I think If you need to cut a side off or something |
Tony's programming blog. DWITE - a programming contest. |
|
|
|
![](images/spacer.gif) |
|
|