I will get the data from the server as NY^NJ^CA^MI or NC^SC etc and need to replace “^” with “,” (coma) . I have tried following two approaches but not working.
Can anyone guide me what went wrong with these approaches?
The problem, is that the caret (^) is a special character in regular expressions which normally represents the start of the current line.
You will need to escape it if you want to match a normal caret: