I want to ignore special characters like ,
"
;
:
using string tokenizer.
For example, if I enter:
He said, "That's not a good idea."
output should be:
He
Said
that
s
not
a
good
idea
This is my current code
class MyClass
{
public static void main(String[] argv)
{
System.out.print("Enter text to break :- ");
Scanner sc = new Scanner(System.in);
String x = sc.nextLine();
StringTokenizer url = new StringTokenizer(x, " ");
while(url.hasMoreTokens())
{
System.out.println(url.nextToken());
}
}
}