Java StringBuffer Examples

Java StringBuffer Reverse Example

Add Comment

  • I think it would be a foolish question to ask but still i am asking that the “Reverse” function of string buffer reverses the index location of characters.But what if i want the string to be in following form..
    “Example Reverse StringBuffer Java” for input string “Java StringBuffer Reverse Example”….

    • see anonymous
      to get the output you desire:
      see each word ends with a space.
      add a space to the inputed sentence at the end.
      start extracting the letters by charAt.
      keep concatenating them.
      stop when there is a space.
      start with the next word.
      i can send the whole program, if you leave your email id here.
      hope it helped.



Facebook Fans