Possible Duplicate:
How do I find the index of a regex match in a string?
How to get the position of a Regex match in a string?
Given the following strings, how can I find the position of the first alpha in each string?
1) - Alpha
2) beta
3) . Gamma
4) 'delta'
Ultimately I'm after the substring, starting at the first alpha character. So I'm looking to offset my substring to get Alpha
.
The offsets I'm looking for (from the above examples) are:
1) 2
2) 0
3) 2
4) 1
I'm not concerned with any special characters. Just the first alpha, case insensitive (A-Za-z).