builtin: improve multi-platform portability for string.split_into_lines() (#17078)

This commit is contained in:
Roy Ivy III 2023-01-24 02:02:25 -06:00 committed by GitHub
parent 0230395062
commit 5cd074a49e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 75 additions and 14 deletions

View file

@ -792,7 +792,7 @@ pub fn (s string) split_into_lines() []string {
if s.len == 0 {
return res
}
#res.arr.arr = s.str.split("\n")
#res.arr.arr = s.str.split(/\r?\n|\r/)
#if (res.arr.arr[res.arr.arr.length-1] == "") res.arr.arr.pop();
#res.arr.len = new int(res.arr.arr.length);
#res.arr.cap = new int(res.arr.arr.length);