Curriculum Foundations Strings, bytes, runes exercise 1 · mcq
Strings, bytes, runes
TypeScript has one string type and no character type — 'A' and
"A" are both strings. Go distinguishes single-quote from double-
quote: one is a single-codepoint *rune*, the other is a string.
Which Go form gives you a single character that you could compare
with other characters?
TypeScript reference
About this theme
Go strings are immutable byte sequences. There are no template literals — fmt.Sprintf does the job. A byte is an alias for uint8; a rune is int32 and represents a Unicode codepoint. When you range over a string, you get runes (codepoints), not bytes. This matters more than it sounds.