PHP » GoLang |
login |
register |
about
|
stripslashesstripslashes[code] func Stripslashes(str string) string { var dstRune []rune strRune := []rune(str) strLenth := len(strRune) for i := 0; i < strLenth; i++ { if strRune[i] == []rune{'\\'}[0] { i++ } dstRune = append(dstRune, strRune[i]) } return string(dstRune) } [/code] |