3 thoughts on “Golang substr or substring equivalent”

    1. Correct, if you use multi byte chars, you have to use runes:

      for i, ch := range “Japan 日本” {
      fmt.Printf(“%d:%q “, i, ch)
      }
      // Output: 0:’J’ 1:’a’ 2:’p’ 3:’a’ 4:’n’ 5:’ ‘ 6:’日’ 9:’本’

Leave a Reply

Your email address will not be published. Required fields are marked *