

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Are there any ways to Manipulate 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
- Related Questions & Answers
- How many ways are there to register a driver in Java?
- How many ways are there to initialize a final variable in java?
- How many ways are there to convert an Array to ArrayList in Java?
- Different ways to concatenate Strings in Java
- Are there any other ways I can improve my concentration other than the Rubic Cube?
- Are there any Male animals which become pregnant?
- Are there any special foods to keep your eyes healthy?
- How many ways are there to initialize the instance variables of a class in java?
- How can I check if there are any selected items in Java JList
- I find ragi bitter in taste. Are there any ways to consume it such that it does not taste bitter?
- Is there any method to convert a Set to immutable in Java
- Are there any style options for the HTML5 Date picker?
- Are there any other healthy teas along with green tea?
- Are there inline functions in Java?
- Is there any alternative solution for static constructor in java?
Advertisements