Nov 25, 2009 #1 keenanbr Programmer Joined Oct 3, 2001 Messages 469 Location IE I'm trying to replace all occurances of '[' with '\[' without success. myString = "abcd[xnj]"; myString.replaceAll("\\[", "\\\\["); can't get it to succeed. help apreciated. Regards,
I'm trying to replace all occurances of '[' with '\[' without success. myString = "abcd[xnj]"; myString.replaceAll("\\[", "\\\\["); can't get it to succeed. help apreciated. Regards,
Nov 25, 2009 Thread starter #2 keenanbr Programmer Joined Oct 3, 2001 Messages 469 Location IE sorry, silly mistake it works newString = myString.replaceAll("\\[", "\\\\["); Upvote 0 Downvote
Nov 25, 2009 #3 Diancecht Programmer Joined Jan 8, 2004 Messages 4,042 Location ES You can reuse the first String Code: myString = myString.replaceAll("\\[", "\\\\["); Cheers, Dian Upvote 0 Downvote