[\'abc\',\'xyz\'] – this string I want turn into abc,xyz using regex in javascript. I want to replace both open close square bracket & single q
[\'abc\',\'xyz\']
abc,xyz
You probably don't even need string substitution for that. If your original string is JSON, try:
js> a="['abc','xyz']" ['abc','xyz'] js> eval(a).join(",") abc,xyz
Be careful with eval, of course.
eval