start « StringBuffer « Java Data Type Q&A

1. Get the index of the start of a newline in a Stringbuffer

I need to get the starting position of new line when looping through a StringBuffer. Say I have the following document in a stringbuffer

"This is a test
Testing Testing"
New lines exist after "test", ...