Aug 18, 2005 #1 SON1 Programmer Joined Nov 21, 2004 Messages 51 Location 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 Joined Jan 8, 2004 Messages 4,042 Location 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 Joined Nov 21, 2004 Messages 51 Location CY nope...that didn't work either Upvote 0 Downvote
Aug 18, 2005 #4 Diancecht Programmer Joined Jan 8, 2004 Messages 4,042 Location 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 Joined Nov 21, 2004 Messages 51 Location CY yeap that worked ! Upvote 0 Downvote