This is my input string
Look - to make links (10) fresh apple (9) This is Apple (7) returns para (6,8) in foot (5)
Expected Output :
Look - to make links (10)
fresh apple (9)
This is Apple (7)
returns para (6,8)
in foot (5)
yy, 2009 Look - to make links
"Look - to make links"
It's hard to tell, but it seems this might be what you want:
String lines = str.split("(?<=\\))");
This splits after every close bracket, retaining the close bracket. The regex is a look behind, which has the form
(?<=...), for a (literal) close bracket. Look aheads/behinds are zero width assertions - so they don't consume any input; essential when you need to split but not lose any of the original content.