How do I convert square brackets to curly brackets in text using regular expression?
I'm trying to convert[[0,0,0,0,0],[0,0,1,0,3],[0,2,5,0,1],[4,2,4,4,2],[3,5,1,3,1]]
this to{{0,0,0,0,0},{0,0,1,0,3},{0,2,5,0,1},{4,2,4,4,2},{3,5,1,3,1}}
Can I do it in a simple way?
I found this Link but it's PHP
way.
I'm trying this on an IDE
like IntelliJ
or online regex tester like regex101.
Thanks.
String.replace('[', '{')
(Even usingString#replace(char, char)
i.o.(String, String)
or that regexreplaceAll
. – Joop Eggen{}
for array initialization) I need to convert every time to paste that to my code. – Heath Kim