This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
Hi, I am facing a problem where escape character getting printed. String str = "first \n second"; expected output is first second Assume that this string "str" is build by some other part of the program and on printing output i am getting is first \n second Please can anyone tell where i am going wrong. Thanks in advance. -arun
Sharing is learning
Philip Shanks
Ranch Hand
Joined: Oct 15, 2002
Posts: 189
posted
0
It's just a hunch, but I would double check that the program that creates the string isn't actually creating it as "\\n". In that case the backslash character itself is being escaped to give a literal backslash. PCS
Philip Shanks, SCJP - Castro Valley, CA
My boss never outsources or has lay-offs, and He's always hiring. I work for Jesus! Prepare your resume!
Biju Philip
Greenhorn
Joined: Nov 03, 2001
Posts: 7
posted
0
Note sure if it's what you want, but here's the platform-independent way to do it:
-Biju [ November 20, 2002: Message edited by: Biju Philip ]