Search for a string within a string

조회 수: 2 (최근 30일)
Joshitha Giridhar
Joshitha Giridhar 2022년 1월 12일
편집: KSSV 2022년 1월 12일
Need to search for a specific string inside a longer string and return the string and its position

답변 (1개)

KSSV
KSSV 2022년 1월 12일
편집: KSSV 2022년 1월 12일
Read about the function strfind.
str = 'Need to search for a specific string inside a longer string and return the string and its position' ;
idx = strfind(str,'string')
idx = 1×3
31 54 76

카테고리

Help CenterFile Exchange에서 Characters and Strings에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by