Skip to content
masterclass Buddy

Go · Function

strings.Split

strings.Split divides a string at every occurrence of a separator. It returns the pieces as a slice, including empty pieces created by adjacent separators.

Last updated

Syntax

func Split(s, sep string) []string

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • SplitN
  • SplitAfter
  • SplitAfterN
  • Cut
  • Fields

Source: strings package - strings - Go Packages. Checked 2026-11-03.