summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorrsiddharth <s@ricketyspace.net>2020-11-22 12:42:54 -0500
committerrsiddharth <s@ricketyspace.net>2020-11-22 12:42:54 -0500
commit437866491fa138669e1c75f79338cb5d86d5d704 (patch)
treeea5d8d181b59af9ee05d6cb5f29a42aebee5e54c /lib
parent02fabe8ee0d05fc22a669b3ba9314aa7ee42b83c (diff)
lib: str: add BytesToStr
Diffstat (limited to 'lib')
-rw-r--r--lib/str.go8
1 files changed, 8 insertions, 0 deletions
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 := ""