How to slice string till particular character in Go?

Viewed 17861

I want to extract a string till a character is found. For example:

message := "Rob: Hello everyone!"
user := strings.Trim(message,

I want to be able to store "Rob" (read till ':' is found).

2 Answers
Related