Created
May 21, 2020 02:46
-
-
Save zhangxiang958/5a4c3ccc03f1fac25c03ec654d37ddc1 to your computer and use it in GitHub Desktop.
获取有效字符(去除字符中的 '\000')
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| func GetValidByte(src []byte) []byte { | |
| var str_buf []byte | |
| for _, v := range src { | |
| if v != 0 { | |
| str_buf = append(str_buf, v) | |
| } | |
| } | |
| return str_buf | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment