Cover page by David Chisnall

Safari, the world’s most comprehensive technology and business learning platform.

Find the exact information you need to solve a problem on the fly, or go deeper to master the technologies and skills you need to succeed

Start Free Trial

No credit card required

O'Reilly logo

6. Manipulating Strings

C was created in America, back when it was fashionable to pretend that the rest of the world didn’t exist, so it used 7-bit ASCII1 characters to represent strings.

Go is more recent, and since then most technology companies in the USA have discovered that it’s quite a good idea to support other languages, mostly so you can sell things to people in other countries. Go uses UTF-8. This is entirely unsurprising, as UTF-8 was originally designed (on a diner placemat) by Rob Pike and Ken Thompson, two of the designers of Go.

Go strings are slightly higher-level than C strings, and there are some important differences. The most obvious is that the Go string type is immutable, like C constant strings and Java strings. Although ...

Find the exact information you need to solve a problem on the fly, or go deeper to master the technologies and skills you need to succeed

Start Free Trial

No credit card required