Write a Java program to reverse a given string with preserving the position of spaces?

File: RemoveChar .java

Output:

India Is my country --> yrtnu oc ym sIaidnI