Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- String str = "aaabbccdddefghjjkklmn";
- for(int i = 1; i < str.length() - 1; i++){
- if (str.charAt(i) != str.charAt(i+1) && str.charAt(i) != str.charAt(i-1)){
- System.out.print(str.charAt(i));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement