Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public String changeXY(String str) {
- if (str.length() == 0) return "";
- if (str.charAt(0) == 'x')
- return "y" + changeXY(str.substring(1));
- return str.charAt(0) + changeXY(str.substring(1));
- }
Add Comment
Please, Sign In to add comment