Clear Filters
Clear Filters

How to replace double quotes with two single quotes in string in MATLAB R2020 ?

10 views (last 30 days)
a = regexprep(' "C:\Users\User's PC\Desktop\note.txt" ' , ' " ' , ' ' );
a = regexprep(' "C:\Users\User's PC\Desktop\note.txt" ' , ' " ' , '');
Invalid expression. Check for missing multiplication operator, missing or unbalanced delimiters, or other syntax error. To construct matrices, use brackets instead of parentheses.

Accepted Answer

Walter Roberson
Walter Roberson on 7 Oct 2021
a = regexprep(' "C:\Users\User''s PC\Desktop\note.txt" ' , '"' , '''''' )
a = ' ''C:\Users\User's PC\Desktop\note.txt'' '

More Answers (0)

Categories

Find more on Characters and Strings in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!