There are some techniques shown
here.
The basic idea, if you want to do it natively/manually, is to find the character(s) separating each line, store that index, find the next separator by starting the search from the position after the previous one, then retrieve the text between those positions/indices.
Then repeat the process for the subsequent lines, starting from the index after the separator ending the previous line, until the end is reached.