0

I read the article https://blog.golang.org/strings and realized that you can only determine the letter by position number using package "unicode/utf8" (maybe I'm wrong). I looked at all the functions of the package, but I did not understand how to do it? I need (pseudocode):

var word := "golang"
var letter := word[3] // letter a
goflow
  • 111
  • 1
  • 1
  • 4
  • @icza It seems, but no. He says how to print all the characters and their positions, I do not understand how to enter a position and get a symbol. – goflow Jul 09 '17 at 17:27
  • Based on the other answer you have all position-symbol pairs. You can't choose a specific pair from this given the position? – icza Jul 09 '17 at 17:33
  • @icza Can I do this task without a loop? – goflow Jul 09 '17 at 17:41
  • You can, if you convert it to a `[]rune` first and index that. But a `for` loop is more efficient. – icza Jul 09 '17 at 17:44
  • This question is not an exact duplicate. – dolmen Jul 19 '17 at 09:05

0 Answers0