Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

String replace

Status
Not open for further replies.

Dins19

Programmer
Aug 15, 2001
6
GB
Hi i am only just beginning in Java.

Suppose i want to replace '-->' with 'then', ':' with '==' and '-' with '&&' in the line below, how should i go about it??

A:B - C:D - E:F --> L

If anyone could please help.
 
Good question, well you can't do it with String.replace() as that only lets you change one char at a time and can't recognise strings (so to speak). There was a similar thread to this afew weeks ago, I shall see if i can hunt it down.
 
check out a similar thread posted by schmmeee posted on the 28 june and last replied to on the 11 August (i.e. it is on the next page of threads).

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top