Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package pkg11111;
- public class Main {
- public static void main(String[] args) {
- String str1 = "iua hiug hfai suh ";
- String [] strArray = str1.split(" ");
- StringBuffer outStr = new StringBuffer("");
- int count= 0;
- for(String str2:strArray){
- count = 0;
- for (int i = 0; i < str2.length(); i++) {
- count++;
- }
- if (count % 2 ==0 ) {
- outStr.append(str2 + " ");
- }
- }
- System.out.println(outStr);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement