how to compare special characters in string

I have a strings
string='$(0)parameter'
I want to find if '$' is present in the string or not. Can any one tell me how to do that? Using which string functions I can achieve that?

2 Comments

Why is $ special ? It's a normal printable character like 3 or "A" or anything like that so you can use strfind().
hey thanks , strfind worked

Sign in to comment.

 Accepted Answer

If index is empty, $ is not in the string
str='$(0)parameter';
index = strfind(str,'$');

1 Comment

if I want to search with '$(0)'. how can i do that?
Because i have to search with {"some name": value, this part.

Sign in to comment.

More Answers (0)

Categories

Tags

Asked:

on 10 Jul 2014

Commented:

on 27 Nov 2019

Community Treasure Hunt

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

Start Hunting!