diff options
author | rsiddharth <s@ricketyspace.net> | 2021-01-30 14:00:29 -0500 |
---|---|---|
committer | rsiddharth <s@ricketyspace.net> | 2021-01-30 14:00:29 -0500 |
commit | d1e448cfa5a2c87de9a22f8717478a9c54bdda99 (patch) | |
tree | 385e5d7e50278a61a47948fbf520217f150b8086 /lib | |
parent | 7dfa85eb027fc27ff858e73f1a1ff5fd5e51a89a (diff) |
lib: update StripSpaceChars
strip 'NUL' character too.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/str.go | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -51,6 +51,9 @@ func StripSpaceChars(s string) string { if s[i] == '\n' { continue } + if s[i] == 0 { // NUL character + continue + } ss += string(s[i]) } return ss |