FileDocCategorySizeDatePackage
Split.javaAPI DocExample712Tue Feb 27 18:41:52 GMT 2001None

Split

public class Split extends Object
Example of using RE `split' method. Remember that `split' makes you specify the boundaries; not the patterns you want to extract but what's between them.
author
Ian F. Darwin, ian@darwinsys.com
version
$Id: Split.java,v 1.1 2001/02/27 23:41:53 ian Exp $

Fields Summary
Constructors Summary
Methods Summary
public static voidmain(java.lang.String[] argv)

		String pattern = "\\W+";	// non-word chars will be the delimiters.
		String input = "QA777. is the next flight. It is on time.";

		RE r = new RE(pattern); // Construct an RE object

		String[] words = r.split(input);

		for (int i = 0; i < words.length; i++) {
			System.out.println(i + " " + words[i]);
		}