Advertisement
UncleSam1505

Untitled

Jan 20th, 2019
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.52 KB | None | 0 0
  1. public class Main {
  2.  
  3.     public static void main(String[] args) {
  4.         String str = "asd asda wq";
  5.         String[] str2= new String[3];
  6.         for(int i = 0, j = 0; i<str.length(); i++){
  7.             char chars = str.charAt(i);
  8.             if (chars >= 'a' && chars <= 'z'){
  9.                str2[j] += chars;
  10.             }
  11.             else if(chars == ' '){
  12.                 j++;
  13.             }
  14.         }
  15.         for(int i = 0; i<str2.length; i++){
  16.             System.out.println(str2[i]);
  17.         }
  18.     }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement