How to find a first letter in a string?
Show older comments
Hello,
I have the following string:
str = '2017-03-28_155051 - JoaquinLR_600fps_ForeheadChestWrist_5minRest';
I would like automatically extract from that string the name, which is JoaquinLR
what would be the best way to do it?
I was thinking maybe I'll find the first letter after space?
1 Comment
KSSV
on 29 Mar 2017
Read about regexp.
Accepted Answer
More Answers (1)
>> str = '2017-03-28_155051 - JoaquinLR_600fps_ForeheadChestWrist_5minRest';
>> regexpi(str,'[a-z]+','match','once')
ans = JoaquinLR
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!