Search for a string within a string

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 日

0 投票

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

カテゴリ

ヘルプ センター および File ExchangeCharacters and Strings についてさらに検索

タグ

質問済み:

2022 年 1 月 12 日

編集済み:

2022 年 1 月 12 日

Community Treasure Hunt

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

Start Hunting!

Translated by