Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
Selected Reading
Manipulating Strings in Java.
Since String class is immutable once created we cannot modify the data of the string. But still if you want to manipulate string data you can rely on StringBuffer or StringBuilder classes.
Example
public class Test {
public static void main(String args[]) {
String str = "Hi welcome ";
StringBuffer sb= new StringBuffer(str);
sb.append("to Tutorialspoint");
System.out.println(sb);
}
}
Output
Hi welcome to Tutorialspoint
Advertisements
