Search for a string within a string

2 visualizzazioni (ultimi 30 giorni)
Joshitha Giridhar
Joshitha Giridhar il 12 Gen 2022
Modificato: KSSV il 12 Gen 2022
Need to search for a specific string inside a longer string and return the string and its position

Risposte (1)

KSSV
KSSV il 12 Gen 2022
Modificato: KSSV il 12 Gen 2022
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

Categorie

Scopri di più su Characters and Strings in Help Center e File Exchange

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by