Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Lesson_30_Activity {
- public static String [] list = {"every", " near ing ", " checking", "food ", "stand", "value "};
- public static void main(String[] args) {
- String [] newlist = new String[list.length];
- int c = 0;
- for(int i = 0; i < list.length; i++) {
- int length = list[i].length();
- if(list[i].contains(" ")) {
- newlist[i] = list[i].replaceAll(" ", "");
- }
- else {
- newlist[i]=list[i];
- }
- System.out.println(newlist[i]);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement