Hi pavanragi,
Would something like this cover your case?
Code:
protected void startApp() {
String in = "Federation of A Chambers of Commerce & Industry Awards for the year 2010-11. Speaking on the occasion," +
"He said, "About 54 percent of the population is youth aged below 25 years. We have to use their energy and" +
"intelligence for development of the state as well as the country.The youth trained will also be absorbed by" +
"companies.’" ";
String out = replace(in, """, "\"");
out = replace(out, " ", " ");
out = replace(out, "’", "’");
out = replace(out, "&", "&");
System.out.println(out);
}
protected String replace(String s, String from, String to) {
int i = s.indexOf(from);
//if the special character is found at least once in the text
if(i >= 0) {
//until all instances of the special character are replaced
while(i >= 0) {
//if the special character is found at the beginning of the text
if(i == 0)
s = to + s.substring(1, s.length());
//if the special character is found after the beginning of the text
else
s = s.substring(0, i) + to + s.substring(i + from.length(), s.length());
//look for new replacements from the current cursor position until the end of the text
i = s.indexOf(from, i + from.length());
}
}
return s;
}