Try to replace your split
line with this:
String[] arr = content.split("<td", -1);
Otherwise you will loose some input in arr
, see the split(String)
API doc:
This method works as if by invoking the two-argument split method with the given expression and a limit argument of zero. Trailing empty strings are therefore not included in the resulting array.
The added -1
makes sure that your content
can also contain "<tr"
at its beginning, for example. See the split(String, int)
API doc for further explanations.