Strings
# Strings
# Immutability
String assignment will not create a new copy of the string. Only string concatenation will create a new buffer for the string.
|
|
Immutability means that individual characters or bytes cannot be reassigned directly.
|
|
We can modify the string by creating a copy:
# Goroutine unsafety
# Runes
len(str) returns the number of bytes for the string. len(rune(str)) returns the actual number of characters.