Home » Developer & Programmer » JDeveloper, Java & XML » ReplaceAll function
ReplaceAll function [message #229024] Thu, 05 April 2007 01:37 Go to next message
alaa_hg
Messages: 12
Registered: November 2006
Location: amman-jordan
Junior Member

hi

i face this problem when i use the replaceAll function

example

String Str = new String ("(Old_String)") ;

i want to replace this String with the ()
with a new one "hi" for example

when i Write the code

Str = Str.replaceAll("(Old_String)","hi") ;

the result is (hi)

i want the result without the ()
i mean i want the result like this hi

can any one help me please


Re: ReplaceAll function [message #229182 is a reply to message #229024] Thu, 05 April 2007 14:19 Go to previous messageGo to next message
vamsi kasina
Messages: 2112
Registered: October 2003
Location: Cincinnati, OH
Senior Member
You may need to put the escape character '\'.
check this
By
Vamsi
Re: ReplaceAll function [message #229500 is a reply to message #229182] Mon, 09 April 2007 00:44 Go to previous message
alaa_hg
Messages: 12
Registered: November 2006
Location: amman-jordan
Junior Member

i think when you use \ it will be a compile error

i try this befor i ask the question
Previous Topic: How to list all tables in oracle..
Next Topic: error message when attempting to email report
Goto Forum:
  


Current Time: Sun Nov 24 13:58:14 CST 2024