reverse a string using string buffer and string builder