Given a String layout of the following form:

```
X......X
....X..X
....X..X

```

Rotate the above layout by 90 degrees clockwise which should be:

```
..X
...
...
...
XX.
...
...
XXX 

```

What's the easiest way to rotate the String characters clockwise by 90 degrees? The String layout can be of any form and any size. What if I have 100000x100000 size String layout?

```
public String rotate(String layout)

```

or

```
public void rotate(String layout)

```