Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2017
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1.  
  2. package pkg11111;
  3.  
  4.  
  5. public class Main {
  6.  
  7.  
  8. public static void main(String[] args) {
  9. String str1 = "iua hiug hfai suh ";
  10. String [] strArray = str1.split(" ");
  11. StringBuffer outStr = new StringBuffer("");
  12. int count= 0;
  13.  
  14. for(String str2:strArray){
  15. count = 0;
  16. for (int i = 0; i < str2.length(); i++) {
  17. count++;
  18. }
  19. if (count % 2 ==0 ) {
  20. outStr.append(str2 + " ");
  21. }
  22. }
  23.  
  24. System.out.println(outStr);
  25. }
  26.  
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement