string

A sequence of characters, that is, a piece of text.

In more detail

Strings are usually written in quotes. In many languages they are immutable, so operations like converting to capitals return a new string.

Examples

'order-1'.encode() turns a Kafka key string into bytes.
name := "api"
Go: name := "api"; the zero value is ""
Go: strings are read-only UTF-8 bytes; the zero value is ""
Java: String is an immutable object; compare with equals, not ==; "ready".toUpperCase() returns "READY".
"ready".toUpperCase()  // "READY"
In Node.js, Buffer.from(text) and buf.toString() convert between strings and bytes.
s = "Hello"
print(s + " world", len(s))

Related terms

Taught in

References

Certification courses