MATLAB: Last Letter in a Text string

text strings

If I have a Text String TS1='%@3Gb6' and I want the last alphabetic character to be printed out (in this case b) what function(s) should I use to accomplish this?

Best Answer

This works:
LastLetter = TS1(max(regexp(TS1, '[A-Za-z]')));
Related Question