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 Center および File ExchangeCharacters and Strings についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by