java tutorial - Java StringBuffer reverse() method - java programming - learn java - java basics - java for beginners
Learn Java - Java tutorial - Java stringbuffer reverse - Java examples - Java programs
Description
The reverse () method — changes the value of the StringBuffer object that called the method.
- Let n be the length of the old sequence of characters contained simply in the string buffer (StringBuffer) before the reverse () method is executed.
- Then, the symbol with the index k in the new sequence of symbols is equal to the symbol with the index nk-1 in the old sequence of symbols. In other words, the method returns a string in the reverse order.
Syntax
Syntax method:
Options
Detailed information about the parameters:
- No.
Return value
- In Java, reverse () returns a StringBuffer with the reverse sequence.In Java, reverse () returns a StringBuffer with the reverse sequence.