From 437866491fa138669e1c75f79338cb5d86d5d704 Mon Sep 17 00:00:00 2001 From: rsiddharth Date: Sun, 22 Nov 2020 12:42:54 -0500 Subject: lib: str: add BytesToStr --- lib/str.go | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'lib/str.go') diff --git a/lib/str.go b/lib/str.go index c71762c..0191806 100644 --- a/lib/str.go +++ b/lib/str.go @@ -33,6 +33,14 @@ func StrToBytes(s string) []byte { return bs } +func BytesToStr(bs []byte) string { + s := "" + for i := 0; i < len(bs); i++ { + s += string(bs[i]) + } + return s +} + // Strip space and newline characters from string. func stripSpaceChars(s string) string { ss := "" -- cgit v1.2.3