Skip to main content
added 2 characters in body
Source Link
paxdiablo
  • 888k
  • 242
  • 1.6k
  • 2k

This is what StringBuilder is meant for. If you're going to be doing a lot of manipulation, do it on a StringBuilder, then turn that into a String whenever you need to.

StringBuilder is described thus: "A mutable sequence of characters. This class provides an API compatible with StringBuffer, but with no guarantee of synchronization".

"A mutable sequence of characters. This class provides an API compatible with StringBuffer, but with no guarantee of synchronization".

It has replace (and append, insert, delete, et al) and you can use toString to morph it into a real String.

This is what StringBuilder is meant for. If you're going to be doing a lot of manipulation, do it on a StringBuilder, then turn that into a String whenever you need to.

StringBuilder is described thus: "A mutable sequence of characters. This class provides an API compatible with StringBuffer, but with no guarantee of synchronization".

It has replace (and append, insert, delete, et al) and you can use toString to morph it into a real String.

This is what StringBuilder is meant for. If you're going to be doing a lot of manipulation, do it on a StringBuilder, then turn that into a String whenever you need to.

StringBuilder is described thus:

"A mutable sequence of characters. This class provides an API compatible with StringBuffer, but with no guarantee of synchronization".

It has replace (and append, insert, delete, et al) and you can use toString to morph it into a real String.

edited body
Source Link
paxdiablo
  • 888k
  • 242
  • 1.6k
  • 2k

This is what StringBuilder (http://java.sun.com/j2se/1.5.0/docs/api/java/lang/StringBuilder.html) is meant for. If you're going to be doing a lot of manipulation, do it on a StringBuilder, then turn that into a String whenever you need to.

StringBuilder is described thus: "A mutable sequence of characters. This class provides an API compatible with StringBuffer, but with no guarantee of synchronization".

A mutable sequence of characters. This class provides an API
compatible with StringBuffer, but with no guarantee of
synchronization.

It has replace (and append, insert, delete, et al) and you can use toString to morph it into a real String.

This is what StringBuilder (http://java.sun.com/j2se/1.5.0/docs/api/java/lang/StringBuilder.html) is meant for. If you're going to be doing a lot of manipulation, do it on a StringBuilder, then turn that into a String whenever you need to.

StringBuilder is described thus:

A mutable sequence of characters. This class provides an API
compatible with StringBuffer, but with no guarantee of
synchronization.

It has replace (and append, insert, delete, et al) and you can use toString to morph it into a real String.

This is what StringBuilder is meant for. If you're going to be doing a lot of manipulation, do it on a StringBuilder, then turn that into a String whenever you need to.

StringBuilder is described thus: "A mutable sequence of characters. This class provides an API compatible with StringBuffer, but with no guarantee of synchronization".

It has replace (and append, insert, delete, et al) and you can use toString to morph it into a real String.

Source Link
paxdiablo
  • 888k
  • 242
  • 1.6k
  • 2k

This is what StringBuilder (http://java.sun.com/j2se/1.5.0/docs/api/java/lang/StringBuilder.html) is meant for. If you're going to be doing a lot of manipulation, do it on a StringBuilder, then turn that into a String whenever you need to.

StringBuilder is described thus:

A mutable sequence of characters. This class provides an API
compatible with StringBuffer, but with no guarantee of
synchronization.

It has replace (and append, insert, delete, et al) and you can use toString to morph it into a real String.