how to compare special characters in string

2 visualizaciones (últimos 30 días)
Ajay Pherwani
Ajay Pherwani el 10 de Jul. de 2014
Comentada: ananth a el 27 de Nov. de 2019
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 comentarios
Image Analyst
Image Analyst el 10 de Jul. de 2014
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 el 11 de Jul. de 2014
hey thanks , strfind worked

Iniciar sesión para comentar.

Respuesta aceptada

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

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Characters and Strings en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by