Re: How to set a character of a String?



Neroku wrote:
Hi, I would like to know how to set a character of an String object.
It's just like the opposite of charAt() method which returns the char
at a given position.

A String is immutable.
Use StringBuffer to create a new String.
.



Relevant Pages

  • How to set a character of a String?
    ... I would like to know how to set a character of an String object. ... It's just like the opposite of charAt() method which returns the char ...
    (comp.lang.java.programmer)
  • Re: How to set a character of a String?
    ... It's just like the opposite of charAt() method which returns the char ... Are you talking about the indexOf("stringtoFind") method of the String ...
    (comp.lang.java.programmer)
  • Re: How to set a character of a String?
    ... It's just like the opposite of charAt() method which returns the char ... You should use StringBuffer. ...
    (comp.lang.java.programmer)
  • Re: Getting rid of double spacing
    ... >using the tokenizer method? ... I was thinking of doing a loop that goes on ... How do I delete a char? ... create a stringbuffer with just the chars you want. ...
    (comp.lang.java.help)
  • a simple question realted to StringBuffer
    ... I am using a StringBuffer to hold a line with fixed length of 72 chars. ... Later, I am going to put char at a specified location, using setCharAtmethod. ...
    (comp.lang.java.programmer)