java - String Tokenizer separation -


I want to know how we can separate the words of a sentence where the delimiter "space" or " is? 'Or'. '

Input

Input: This is a STRING program. Is it easy? Yes, IS .

Output:

  This is an ARM program. It's easy to have a  

Look at the constructor In class there is a provision for accepting a custom delimiter in Java.

Try it:

  stringtochnizer tokenizer = new string-locator ("This is a STRING program. Is it easy? Yes, IT", ".?"); While (tokenizer.hasMoreElements ()) {System.out.println (tokenizer.nextElement ()); }  

Comments

Popular posts from this blog

python - rpy2 import is not working -

c++ - How to load a bitmap from file into the samples buffer -

javascript - How to get MySQL query result returned using $.ajax -