adding single quotation to a string
Mostrar comentarios más antiguos
Hi everybody,
my code accept just this format of String --> filename='"GComScan_20200115_135716.sdb"' (first and last Quotes are single) why i dont know ?
i have tried with this command to get that, but the result was reverse, means first and last Quotes are dobble " ' ' " (without space).
filename = "'" + string(extractBetween(filename, "Scans\\", filename(end)))+ "'"

Result.

the right one;

How can I solve this issue? Thank you.
Respuesta aceptada
Más respuestas (2)
Walter Roberson
el 15 de En. de 2020
filename = char( extractBetween(filename, "Scans\\", filename(end)) ) ;
1 comentario
MoHa
el 15 de En. de 2020
Ivan
el 29 de En. de 2021
sprintf('STRING=''"%s"''','MY STRING')
2 comentarios
Ivan
el 30 de En. de 2021
@Adam Danz sorry, yes, wrong answer, seems it was for another question, too much opened tabs in the browser.
Thats surprise, you've been in Tomsk, nice old city with a lot of students. I also have been there for a week, have made seminars for students, control systems with MATLAB. Amazing world.
Categorías
Más información sobre Creating, Deleting, and Querying Graphics Objects en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!