// 文字列配列から指定したindexの要素を削除する
// 注意: runtime error: out of range 発生する恐れ有り
func unset(str []string, index int) []string {
if index >= 0 {
return append(str[:index], str[index+1:]...)
} else {
return append(str[:len(str)+index], str[len(str)+index+1:]...)
}
}
More than 5 years have passed since last update.
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme