← All notes

Go strings: UTF-8 helpers such as Contains, Split, and Join

Answer: Package strings implements simple functions to manipulate UTF-8 encoded strings. Contains reports whether substr is within s. Join concatenates elems with a sep string. Split slices a string around a separator.

Examples

package main
import "strings"

func main() {
    _ = strings.Contains("hello", "ell")
    parts := strings.Split("a,b,c", ",")
    _ = strings.Join(parts, ":")
}

Notes

Join writes the first element, then each separator and remaining element, into a Builder.

Reference list

See also

Claims

Sources

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: Go docs, strings package; Go source, strings.go. BSD-3-Clause (https://go.dev/LICENSE). Copyright The Go Authors. Text was condensed and changed from the originals.

License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: Go docs, strings package; Go source, strings.go. BSD-3-Clause (https://go.dev/LICENSE). Copyright The Go Authors.

Cite this

Permanent ID: iil:note:3cgfr8ft

iinventedlight. 2026. "Go strings: UTF-8 helpers such as Contains, Split, and Join." iinventedlight Library, iil:note:3cgfr8ft, version of 2026-11-18. https://iinventedlight.com/library/notes/go-strings/. License: CC-BY-4.0.

@misc{iil_note_3cgfr8ft,
  author = {{iinventedlight}},
  title = {{Go strings: UTF-8 helpers such as Contains, Split, and Join}},
  howpublished = {iinventedlight Library},
  year = {2026},
  date = {2026-11-18},
  url = {https://iinventedlight.com/library/notes/go-strings/},
  note = {Permanent ID iil:note:3cgfr8ft. License: CC-BY-4.0.},
}

Markdown

Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com. Or Report a correction (no account needed).

For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/go-strings.md.