From 84cabad5fcf2224197526301ff82c08018eae7f5 Mon Sep 17 00:00:00 2001 From: rsiddharth Date: Sat, 5 Sep 2020 18:51:19 -0400 Subject: lib: move around stripSpaceChars * lib/b64.go (stripSpaceChars): Move to... * lib/str.go (stripSpaceChars): ...here. --- lib/str.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'lib/str.go') diff --git a/lib/str.go b/lib/str.go index e0cb8ae..84f80ab 100644 --- a/lib/str.go +++ b/lib/str.go @@ -13,3 +13,18 @@ func FillStr(a string, l int) string { } return b } + +// Strip space and newline characters from string. +func stripSpaceChars(s string) string { + ss := "" + for i := 0; i < len(s); i++ { + if s[i] == ' ' { + continue + } + if s[i] == '\n' { + continue + } + ss += string(s[i]) + } + return ss +} -- cgit v1.2.3