How can I get line number form a string?
Suppose I have a string like this
String testString = "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis p";
And also I have a view that will show the string. In a different case, I want to get the line number first before rendering.
I want to get the line number from this string in Android. I got several ways to get the line number. But In every solution, we can get the line number after view rendering. But I want it before rendering of the view. I want to get the line number for 20 or more different strings.
How can I get this any idea?