PHP » GoLang |
login |
register |
about
|
mb_substrmb_substrJust convert it to a slice of runes first, slice, then convert the result back: str:="абвгд" // get 3 first string([]rune(str)[:3]) //returns абв // get from 1 (included) to 4 (not included) fmt.Println(string([]rune(str)[1:4])) // returns бвг |