Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Beautify {
- public static void main(String[] args){
- System.out.println(beaut("trots", 't'));
- }
- public static String beaut(String in, char b){
- String result = "";
- for(String s = in; s.length() > 0; s = s.substring(1)){
- if(s.charAt(0) != b){
- result = result + Character.toString(s.charAt(0));
- }
- }
- return result;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement