Java tutorial
public class Main { public static void main(String[] args) { String original = "java2s.com"; String[] words = original.split("\\s+"); System.out.print("Reversed String in Place:" + " "); for (int i = words.length - 1; i >= 0; i--) { System.out.print(words[i] + " "); } } }