how to reverse n characters of n parts in string using java : <p>For example, string = "ABCDEFGH". if n=2, then output should be "BADCFEHG"; if n=3, output should be "CBAFEDHG".
I know i should use stringbuilder to reverse, but how can i split the string to n parts and then reverse each part?</p>
