how to compare special characters in string

조회 수: 1 (최근 30일)
Ajay Pherwani
Ajay Pherwani 2014년 7월 10일
댓글: ananth a 2019년 11월 27일
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().
Ajay Pherwani
Ajay Pherwani 2014년 7월 11일
hey thanks , strfind worked

댓글을 달려면 로그인하십시오.

채택된 답변

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