Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Main {
- public static void main(String[] args) {
- String str = "asd asda wq";
- String[] str2= new String[3];
- for(int i = 0, j = 0; i<str.length(); i++){
- char chars = str.charAt(i);
- if (chars >= 'a' && chars <= 'z'){
- str2[j] += chars;
- }
- else if(chars == ' '){
- j++;
- }
- }
- for(int i = 0; i<str2.length; i++){
- System.out.println(str2[i]);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement