Search substring in character array

How can I find of a substring is present in a character array? The position is´t really important.

Answers (1)

Ameer Hamza
Ameer Hamza on 8 May 2018
Edited: Ameer Hamza on 8 May 2018
See strfind(). Or if position is not important then use contains().

2 Comments

Undefined function 'contains' for input arguments of type 'char'. I get this error
Ameer Hamza
Ameer Hamza on 8 May 2018
Edited: Ameer Hamza on 8 May 2018
contains() was introduced in R2016b. Which MATLAB version are you using?

Sign in to comment.

Categories

Asked:

on 8 May 2018

Edited:

on 8 May 2018

Community Treasure Hunt

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

Start Hunting!