23
As the question states given the following code:
public class Foo
{
public static void main(String[] args)
{
String test = "Cats go meow";
String[] tokens = test.split(" ");
}
}
is it possible to precompile that regex in the split function along the lines of this:
public class Foo
{
Pattern pattern = Pattern.compile(" ");
public static void main(String[] args)
{
String test = "Cats go meow";
String[] tokens = test.split(pattern);
}
}