Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

How do I find the index for each letter in a word?

$
0
0
For example:
dim word as string = "apple"
dim index as integer
index = word.IndexOf("p")



This code only returns me with 1 which is only the index for the first p not both of them. What I need the program to do is find the index for both p's and return with a value similar to (1,2)

Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>