Stringbuilder character sequence can be reversed with the help of reverse() method in java. reverse() function reverse characters and words in starting from to ending of character sequence in the String. Use of String reverse() in java is shown below.
Example of StringBuilder reverse() in java, JSP
public class StringBuilderReverseExample { public static void main(String[] args) { StringBuilder sb = new StringBuilder(); sb.append("Java Stringbuilder"); sb.reverse(); System.out.println("StringBuilder :"+sb); } }
Output
StringBuilder :redliubgnirtS avaJ
Tags: StringBuilder




Link to Us