extract integers from random strings

1 view (last 30 days)
EK
EK on 11 Dec 2013
Commented: EK on 11 Dec 2013
Hi,
I have many strings composed by letters and numbers. Every string has this format 'randomword.integer'. I'd like to ignore the first part (word) and get the second (number). The first part keep changing so i can't use:
a= 'randomword.integer'
int=sscanf(a,'randomword.%d')
Any help?
Thanks in advance

Accepted Answer

Walter Roberson
Walter Roberson on 11 Dec 2013
sscanf(a, '%*[^.].%d')

More Answers (0)

Categories

Find more on Characters and Strings in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!