What is the most efficient algorithm for reversing a String in Java?

Posted by Hultner on Stack Overflow See other posts from Stack Overflow or by Hultner
Published on 2010-03-13T16:56:56Z Indexed on 2010/03/13 17:05 UTC
Read the original article Hit count: 198

I am wondering which way to reverse a string in Java that is most efficient. Should I use some sort of xor method? The easy way would be to put all the chars in a stack and put them back into a string again but I doubt that's a very efficient way to do it. And please do not tell me to use some built in function in Java. I am interested in learning how to do it not to use an efficient function but not knowing why it's efficient or how it's built up.

© Stack Overflow or respective owner

Related posts about java

Related posts about algorithms