OP wrote:
trying to split a string twice
String example = response;
String [] array = example.split("<section>");
System.out.println(array[0]);
String [] array2 = example.split("<title>");
System.out.println(array2[2])
If i understand you well, you're trying to split some text into parts based on different condition. Firtly, you want to devide text on "
<section>
" then (secondly) on "
<title>
" statement.
Now, have a look at mine pseudo-code (i'm not familiar with java enough):
String [] array = example.split("<section>");
System.out.println(array[0]);
for(int i=0,array[].UBound(),i++)
{
String [] array2 = array[i].split("<title>");
}
Do you see the difference?