Reputation: 33223
I have data in following format
<foo bar> <property abc> <this foo bar> .
Now there are essentially 4 parts in this string: foo bar
; property abc
; this foo bar
; and .
. How do I tokenize the above string into these four parts?
Upvotes: 0
Views: 228
Reputation: 28646
As others have suggested if you want to parse RDF graphs just use a library like Apache Jena (disclaimer - I am one of the developers).
If your problem is more that you need direct control over the parsing process then there are several options:
Upvotes: 1
Reputation: 906
String[] array = string.split("> ");
for (int i = 0; i < array.length -1; i++){
System.out.println(array[i] + ">");
}
System.out.println(array[array.length-1]);
Upvotes: 0