Storing numeric index of alphabetic character in text string

How do I store the numeric index of the first alphabetic character in a text string? For example, TS1='%@3Gb6' returns Alpha1=4.

1 Comment

Here are two simple methods to get the indices of the alphabetic characters:
>> TS1 = '%@3Gb6';
>> regexp(TS1,'[A-Za-z]','once') % only the first
ans = 4
>> find(isstrprop(TS1,'alpha')) % all alphabetic
ans =
4 5
What do you want to do with the indices?

Sign in to comment.

Answers (1)

Categories

Asked:

on 21 Jan 2016

Answered:

on 11 Feb 2016

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!