Hi All, How replace the string that contains "(abc)" to "xyz". Example String s = "This is the (abc)" to "This is a Test". The String.replaceAll and replaceFirst are unable replace. Thanks With regards Josi
A String Object in Java is immutable so you cannot possibly modify the contents of a exisisting String. You can copy the contents to a StringBuffer and then replace the old string with the new one and then point the newly modified string to the Original one. Say for Example Pseudo code will look like String S = "Will Replace abc to xyz"; StringBuffer sb = new StringBuffer(s); sb.replace() and then assign the sb value to s again.
"amit@apollo Dubey", Please read the rules for display names here. Your display name is not valid. We require your display name to be two words: your first name, a space, then your last name. Fictitious names are not allowed. Please edit your profile so that your display name is valid. Accounts with invalid display names get deleted, often without warning. thanks, Dave.