Go言語では"\0"
とやってもNUL文字が出力されないようです。
文字列の途中や最後にNUL文字を入れるには、
nulChar := string([]byte{0})
includeNul := strings.Join("hoge", nulChar, "huga")
//=> "hoge\0huga"
とするしか無い?
もっといい方法がないのだろうか…
Go to list of users who liked
Share on X(Twitter)
Share on Facebook
More than 5 years have passed since last update.
Go言語では"\0"
とやってもNUL文字が出力されないようです。
文字列の途中や最後にNUL文字を入れるには、
nulChar := string([]byte{0})
includeNul := strings.Join("hoge", nulChar, "huga")
//=> "hoge\0huga"
とするしか無い?
もっといい方法がないのだろうか…
Register as a new user and use Qiita more conveniently
Go to list of users who liked