how to compare special characters in string

5 次查看(过去 30 天)
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 个评论
Image Analyst
Image Analyst 2014-7-10
Why is $ special ? It's a normal printable character like 3 or "A" or anything like that so you can use strfind().

请先登录,再进行评论。

采纳的回答

Sara
Sara 2014-7-10
If index is empty, $ is not in the string
str='$(0)parameter';
index = strfind(str,'$');
  1 个评论
ananth a
ananth a 2019-11-27
if I want to search with '$(0)'. how can i do that?
Because i have to search with {"some name": value, this part.

请先登录,再进行评论。

更多回答(0 个)

类别

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