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

Antworten (1)

KSSV
KSSV am 12 Jan. 2022
Bearbeitet: KSSV am 12 Jan. 2022

0 Stimmen

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

Kategorien

Mehr zu Characters and Strings finden Sie in Hilfe-Center und File Exchange

Tags

Gefragt:

am 12 Jan. 2022

Bearbeitet:

am 12 Jan. 2022

Community Treasure Hunt

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

Start Hunting!

Translated by