This question already has an answer here:
- replace String with another in java 5 answers
The string output is "data", "data1", "data2", "data3"
i want it to replace "
with '
so the string output will be 'data', 'data1', 'data2', 'data3'
Thanks :)
use String class replaceAll method
Syntax:
public String replaceAll (String regularExpression, String replacement)
In your case
Then you will get output as
From Android API,
replaceAll
sayssimply use String class to make this happen like:
Method 1: Using String
replaceALL
Output:
Method 2: Using
Pattern.compile
Method 3: Using
Apache Commons
as defined in the link below: