String comparison

Version 1.1.0.0 (1.23 KB) by Christian
The function searches for a string inside a given target and returns 1 for found or 0 for not found.
258 Downloads
Updated 19 Aug 2013

View License

The function searches for a string inside a given target string and returns 1 for found or 0 for not found.

The format can be either cell or string.

Example:

target = 'Marc goes fishing'
searchterm = 'goes'

The function will return 1.

Cite As

Christian (2024). String comparison (https://www.mathworks.com/matlabcentral/fileexchange/43064-string-comparison), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2013a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Categories
Find more on Characters and Strings in Help Center and MATLAB Answers

Community Treasure Hunt

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

Start Hunting!
Version Published Release Notes
1.1.0.0

Included the suggestions of Richard and Jan. No loops anymore and I included an error message.

1.0.0.0