use fields instead of split to split on all whitespace

This commit is contained in:
Hayden Johnson 2026-02-15 17:35:58 -08:00
parent 6d2293685f
commit b1fc251574

View file

@ -22,7 +22,8 @@ import "core:strings"
getSpaceDelimetedItems :: proc(backingBuffer: []byte) -> []string { getSpaceDelimetedItems :: proc(backingBuffer: []byte) -> []string {
count, _ := os.read(os.stdin, backingBuffer) count, _ := os.read(os.stdin, backingBuffer)
response := string(backingBuffer[:count - 1]) // leave off the newline response := string(backingBuffer[:count - 1]) // leave off the newline
items, _ := strings.split(response, " ") strings.trim_space(response)
items, _ := strings.fields(response)
return items return items
} }