| Author |
String replace
|
Chandra S Marappa
Greenhorn
Joined: Apr 26, 2005
Posts: 19
|
|
|
How to replace one string with another string
|
Regds<br />---------------<br />Chandru
|
 |
Jan Groth
Ranch Hand
Joined: Feb 03, 2004
Posts: 456
|
|
Hi chandar, in order to help you we need more details. You might also want to study the String API, there are loads of methods, most of them quite self explaining by their name & parameter list... Greets, Jan
|
 |
Naren Chivukula
Ranch Hand
Joined: Feb 03, 2004
Posts: 542
|
|
Hi,
Originally posted by Chandra Shekar marappa How to replace one string with another string
String literals can't be changed once created. If you mean to ask about replacement of string variables, simple overwrite the existing string variable with new string reference Regards, Narendranath
|
Cheers,
Naren (SCJP, SCDJWS and SCWCD)
|
 |
Hentay Duke
Ranch Hand
Joined: Oct 27, 2004
Posts: 198
|
|
First you must understand how Strings are immutable. Then you describe exactly what you want. But a simplistic answer would be. String string1 = "String 1"; String string2 = "String 2"; string1 = string2; But be warned you must grasp the immutable quality of Strings, because this may not be doing what you expect it to do.
|
 |
 |
|
|
subject: String replace
|
|
|