How to slice one string in Go language into array of string letters it contains?
For example, turn string \"abc\" into array \"a\", \"b\", \"c\".
I think Split is what you're looking for:
func Split(s, sep string) []string
If sep
is an empty string
, it will split the string into single characters:
Split slices s into all substrings separated by sep and returns a slice of the substrings between those separators. If sep is empty, Split splits after each UTF-8 sequence. It is equivalent to SplitN with a count of -1.