Search for a string within a string

1 次查看(过去 30 天)
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