Anyway, I want to split word like these:
"If it snows today, then we will go skiiing." -> "it snows today" , "we will go skiing".
"It is not Friday." -> "It is Friday"
Currently I know about using split() to split string. But, I don't know how to split the way I want to. the one below just my test class to find it.
public class test2
{
public static void main(String [] args)
{
String str = "If it snows today, then we will go skiing";
String [] result = str.split(" ");
for (String string : result)
System.out.println(string);
}
}
I planned to make the program find pattern of if p then q, not p, p implies q, p if only if q and etc. But, I don't think I can use StringTokenizer to find pattern.
This post has been edited by shad0wk1: 27 November 2012 - 08:43 AM

New Topic/Question
Reply



MultiQuote





|