1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

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
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);