Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
I need to change:
"," ":" "{" "}"
From string to ""
""
I wrote this:
Regex remove = new Regex("\"\"\":\"\"{\"\"}\"]"); remove.Replace(str, "");
But this didn't change the values I needed to change. Where did I make a error?
The replace method returns the replaced string.
You should try
Regex remove = new Regex(",|:|\\{|\\}"); str = remove.Replace(str, "");
Note: The regex looks for , : { and } within "".
EDIT: Modified Code with regular expressing string as well, thanks to ArsenMkrt