I have the following data text :
[data]A[/data]
aaa
4 5 8
[data]B[/data]
bbb
3 1 9
[data]C[/data]
ccc
6 5 2
...
I want to split them in to the following 3 units :
1st unit :
[data]A[/data]
aaa
4 5 8
2nd unit :
[data]B[/data]
bbb
3 1 9
3rd unit :
[data]C[/data]
ccc
6 5 2
So my code looks like this :
String Units[]=dataText.split("[data]");
Yet, this doesn't do it properly, what's the right way to split it ?
If I use regex, how should I write the expression ?