I have this string:
" <li>Ponto de orvalho: 16&#176; C</li>"
and I want to extract the number 16, but this number can change.
I was doing this: Torvalhoactual=str2num([tline(57),tline(58)]);
but since the number can change to 1 digital number this code crashes

 채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2014년 7월 18일

0 개 추천

string='de orvalho: 16° C</li'
out=str2double(regexp(string,'\d+','match'))

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Characters and Strings에 대해 자세히 알아보기

질문:

2014년 7월 18일

답변:

2014년 7월 18일

Community Treasure Hunt

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

Start Hunting!

Translated by