We break down the string model in Go: why
string is a sequence of bytes, why strings are immutable, what expressions
len
(
s
),
s
[
i
], and
s
[
a
:
b
] actually return, how to avoid
panic: index out of range, and how to “modify” a string correctly—by creating a new one. In practice, we will write an ASCII function
titleASCII() and learn to diagnose strings by printing them byte by byte.