C
chris1980
OMG. This is like my worst nightmare. i wanted to replace all "*" with
"occupant". like for instance: by doing alot of research i still cannot
get a good description on stirngbuffer replace method. here is my
program for the time being. i wanted to keep it as simple.
class MailGenerator {
public static void main(String[] args) {
String st = ("I have * exciting * news for you, *!!!. For just $49.99
plus postage");
StringBuffer sb = new StringBuffer(st);
sb.replaceAll(st, "*", "Occupant");
System.out.println(sb);
}
}
i want to replace * by occupant. i cant seem to rite replaceall method.
i looked at the api it asks for the starting index and ending index. i
can't make any sense of it. appreciate any help.
"occupant". like for instance: by doing alot of research i still cannot
get a good description on stirngbuffer replace method. here is my
program for the time being. i wanted to keep it as simple.
class MailGenerator {
public static void main(String[] args) {
String st = ("I have * exciting * news for you, *!!!. For just $49.99
plus postage");
StringBuffer sb = new StringBuffer(st);
sb.replaceAll(st, "*", "Occupant");
System.out.println(sb);
}
}
i want to replace * by occupant. i cant seem to rite replaceall method.
i looked at the api it asks for the starting index and ending index. i
can't make any sense of it. appreciate any help.