Skip to main content
← Back to Code Arena
Medium Engineer SpeedRun strings utf8 runes

Go: len() of a UTF-8 String

+200 XP · 6 min · attempt 1

Problem

What integer does len("héllo") return in Go? (The second character is the lowercase e with acute accent, U+00E9.) Enter a single integer.

Starter

// In Go, len(string) returns the number of BYTES,
// not the number of runes. UTF-8 multi-byte characters count as more than one byte.

Your answer

Log in to submit