Returns an array consisting of the lines in the string

string:split_to_lines(STRING $string) : ARRAY

string:split_to_lines("line 1\nline 2")
#=> [ "line 1", "line 2" ]

string:split_to_lines("")
#=> [ "" ]

string:split_to_lines("hi")
#=> [ "hi" ]

string:split_to_lines("line 1\n\rline 2")
#=> [ "line 1", "line 2" ]

Copyright ©2013-2022 SunSed®. All rights reserved.