Aug 18, 2005 #1 SON1 Programmer Nov 21, 2004 51 CY i want to replace a word with \' (including the slash) unfortunately i am not able to do it with this temp = temp.replaceAll("word","\\'"); anyone knows how to ?
i want to replace a word with \' (including the slash) unfortunately i am not able to do it with this temp = temp.replaceAll("word","\\'"); anyone knows how to ?
Aug 18, 2005 1 #2 Diancecht Programmer Jan 8, 2004 4,042 ES I think you miss a slash. Code: temp = temp.replaceAll("word","\\\'"); You need one to escape the slash itself and another one to slash the whatever ' is called in English. Single quotation mark, perhaps? Cheers, Dian Upvote 0 Downvote
I think you miss a slash. Code: temp = temp.replaceAll("word","\\\'"); You need one to escape the slash itself and another one to slash the whatever ' is called in English. Single quotation mark, perhaps? Cheers, Dian
Aug 18, 2005 Thread starter #3 SON1 Programmer Nov 21, 2004 51 CY nope...that didn't work either Upvote 0 Downvote
Aug 18, 2005 #4 Diancecht Programmer Jan 8, 2004 4,042 ES Right, two more slashes. Code: temp = temp.replaceAll("word","\\\\\'"); I'll never understand the slashes thingie. Cheers, Dian Upvote 0 Downvote
Right, two more slashes. Code: temp = temp.replaceAll("word","\\\\\'"); I'll never understand the slashes thingie. Cheers, Dian
Aug 18, 2005 Thread starter #5 SON1 Programmer Nov 21, 2004 51 CY yeap that worked ! Upvote 0 Downvote