A word is a set of characters, delimited by spaces and punctuation.

Help solve

Closed due to the fact that the essence of the question is incomprehensible to the participants of Streletz , HamSter , rjhdby , Denis , cheops on Oct 16 '16 at 5:47 .

Try to write more detailed questions. To get an answer, explain what exactly you see the problem, how to reproduce it, what you want to get as a result, etc. Give an example that clearly demonstrates the problem. If the question can be reformulated according to the rules set out in the certificate , edit it .

    1 answer 1

    You can for example like this

    Scanner in = new Scanner(System.in); String s = in.next(); 

    UPDATE:

     String[] words = s.split("\W"); 
    • and further: String [] strings = s.split (""); - Mikhail Kolomiyets
    • There are no spaces in the split, the split will not work - Yegor Myaus
    • s.split ("[.,]") will do? - Mikhail Kolomiyets
    • str.split ("(? <= \\ G. {6})", 6); This is how it works - Egor Myaus