Guest User

Untitled

a guest
May 20th, 2018
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.20 KB | None | 0 0
  1. public String changeXY(String str) {
  2. if (str.length() == 0) return "";
  3.  
  4. if (str.charAt(0) == 'x')
  5. return "y" + changeXY(str.substring(1));
  6.  
  7. return str.charAt(0) + changeXY(str.substring(1));
  8. }
Add Comment
Please, Sign In to add comment