From 5dcd2303c99616b24d104d1b424384eae2b8eb05 Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Tue, 9 Jun 2020 10:15:17 +0200 Subject: [PATCH] builtin: fix string.fields() --- vlib/builtin/string.v | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vlib/builtin/string.v b/vlib/builtin/string.v index 475b9753aa..2591742d4a 100644 --- a/vlib/builtin/string.v +++ b/vlib/builtin/string.v @@ -1345,7 +1345,8 @@ pub fn (s string) repeat(count int) string { } pub fn (s string) fields() []string { - return s.split(' ') + // TODO do this in a better way + return s.replace('\t', ' ').split(' ') } // Allows multi-line strings to be formatted in a way that removes white-space