Use the code below:
// conversion from String object to StringBuffer
StringBuffer sbr = new StringBuffer(str);
// To reverse the string
sbr.reverse();
Welcome to my blog
Use the code below:
// conversion from String object to StringBuffer
StringBuffer sbr = new StringBuffer(str);
// To reverse the string
sbr.reverse();