public class StringParserDemo
{
public static void main(String[] args)
{
String s = "Hello World: \"how are you?\" - 123 4.5";
Object[] data = new Object[3];
if (StringParser.parse(s,"Hello World: %S - %d %f",data,StringParser.QUOTE_CHARS))
{
System.out.printf("%s\n",(String)data[0]);
System.out.printf("%d\n",(Integer)data[1]);
System.out.printf("%f\n",(Double)data[2]);
}
}
}
Note: please have a look in StringParser.java for details!
2009-09-15 0.02
* add number format exception handler
2008-11-12 0.01
* initial public release
Back to top