Extracting the numeric part from a cell

1 view (last 30 days)
Hi everyone,
I have a column string in this format
I want to extract the numeric part that starts with 9 like 94577 from roow one for instance. Can anyone help please? Thank you.

Accepted Answer

Paul on 17 Nov 2021
str = ["injection-0:94577)"
str = 7×1 string array
"injection-0:94577)" "injection-0:94578)" "injection-0:94579)" "injection-0:94580)" "injection-0:94581)" "injection-0:94582)" "injection-0:94583)"
newstr = extractBefore(extractAfter(str,":"),")")
newstr = 7×1 string array
"94577" "94578" "94579" "94580" "94581" "94582" "94583"

Sign in to comment.

More Answers (1)

per isakson
per isakson on 17 Nov 2021
>> extractBetween( "injection-0:94582)", ":", ")" )
ans =


Community Treasure Hunt

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

Start Hunting!

Translated by