{"id":2317,"date":"2020-06-20T21:01:04","date_gmt":"2020-06-20T15:31:04","guid":{"rendered":"https:\/\/golangbyexamples.com\/?p=2317"},"modified":"2021-04-06T18:10:40","modified_gmt":"2021-04-06T12:40:40","slug":"length-of-string-golang","status":"publish","type":"post","link":"https:\/\/golangbyexamples.com\/length-of-string-golang\/","title":{"rendered":"Length of string in Go (Golang)"},"content":{"rendered":"\n

In Golang string is a sequence of bytes. A string literal actually represents a UTF-8 sequence of bytes. In UTF-8, ASCII characters are single-byte corresponding to the first 128 Unicode characters. All other characters are between 1 -4 bytes. To understand it more consider the below string<\/p>\n\n\n\n

sample := \"a\u00a3c\"<\/code><\/pre>\n\n\n\n

In above string<\/p>\n\n\n\n