diff options
author | rsiddharth <s@ricketyspace.net> | 2020-11-22 12:42:54 -0500 |
---|---|---|
committer | rsiddharth <s@ricketyspace.net> | 2020-11-22 12:42:54 -0500 |
commit | 437866491fa138669e1c75f79338cb5d86d5d704 (patch) | |
tree | ea5d8d181b59af9ee05d6cb5f29a42aebee5e54c /lib/str.go | |
parent | 02fabe8ee0d05fc22a669b3ba9314aa7ee42b83c (diff) |
lib: str: add BytesToStr
Diffstat (limited to 'lib/str.go')
-rw-r--r-- | lib/str.go | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -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 := "" |