Consider the following VB code:
Dim fooBar As String
fooBar = "Foo Bar"
Dim q As String
q = fooBar(0)
In VB.Net, this compiles and my q string variable is set to the letter "F", however in VB6 I get a compile error, as the compiler expects an array.
I am in a scenario in VB6 where it would be really useful to be able to treat a string this way, as in access the individual characters via an indexer or something similar.
How do I access the individual characters of a string in VB6?
Thankyou
Use Mid
:
q = Mid(fooBar, 1, 1)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With