Use a back quote instead of an apostrophe, example:

idPost = strings.Split(idPost,`"`)
Answer from Timofey Belanenko on Stack Overflow
🌐
Go Packages
pkg.go.dev › strings
strings package - strings - Go Packages
FieldsFunc splits the string s at each run of Unicode code points c satisfying f(c) and returns an array of slices of s. If all code points in s satisfy f(c) or the string is empty, an empty slice is returned. Every element of the returned slice is non-empty.
🌐
GeeksforGeeks
geeksforgeeks.org › go language › how-to-split-a-string-in-golang
How to Split a String in Golang? - GeeksforGeeks
July 12, 2025 - The Split function divides a string into all substrings separated by the specified separator and returns a slice with these substrings.
🌐
YourBasic
yourbasic.org › golang › split-string-into-slice
3 ways to split a string into a slice · YourBasic Go
yourbasic.org/golang · Split on comma or other substring · Split by whitespace and newline · Split on regular expression · Use the strings.Split function to split a string into its comma separated values. s := strings.Split("a,b,c", ",") ...
🌐
Educative
educative.io › answers › how-to-split-a-string-in-golang
How to split a string in Golang
The Split() method​ in Golang (defined in the strings library) breaks a string down into a list of substrings using a specified separator.
🌐
Scaler
scaler.com › home › topics › golang › golang string split function
GoLang String Split Function - Scaler Topics
December 16, 2022 - The functions are defined in the string package and hence need to be imported before using the function. The method split() in the Golang Split String is defined as a string library that breaks the string into a list of substrings by using a specified separator.
🌐
Reddit
reddit.com › r/golang › string splitting
r/golang on Reddit: String Splitting
December 30, 2019 -

I am trying to split a string in the easiest way possible. I have three variables of data to get from a split string. I already have the first one answered.

c := "bf19a/dba14@org:dye"
ss := strings.Split(login, "/")[0]  // Get Everything before the first /
ss2 := strings.Split(strings.Split(login, "/")[1], "@")[0]//Get everything between the first / and @
ss3 := strings.Split(login, "@")[1] // Get Everything after the @

My issue is now, if the string looks like this but I still need the 3 variables of data

c := "bf19a/dba14.jake/helo@ess.com@org:dye"
// Get Everything before the first /
// Get Everything between the first / and the second @
// Get Everything after the second @
Find elsewhere
🌐
CodeSignal
codesignal.com › learn › courses › go-string-manipulation-for-beginners › lessons › splitting-and-joining-strings-in-go
Splitting and Joining Strings in Go
In Go, the strings.Split function cuts a string into several pieces based on a delimiter, which is a character that separates words. It returns a slice containing these divided parts.
🌐
Golang Docs
golangdocs.com › home › 5 different ways to split string in golang
5 Different Ways to Split String in Golang - Golang Docs
January 28, 2020 - The strings package contains a function called split(), which can be used to split string efficiently.
🌐
Hugo
gohugo.io › functions › strings › split
strings.Split
1 month ago - {{ split "tag1,tag2,tag3" "," }} → ["tag1", "tag2", "tag3"] {{ split "abc" "" }} → ["a", "b", "c"] The strings.Split function essentially does the opposite of the collections.Delimit function.
🌐
Leapcell
leapcell.io › blog › how-to-split-strings-in-go
How to Split Strings in Go | Leapcell
July 25, 2025 - The function f considers any character that is not a letter or number as a separator, effectively splitting the string at punctuation marks and spaces. As of Go 1.20, the standard library does not provide a function to split a string by multiple substrings directly.
🌐
Boot.dev
boot.dev › blog › golang › splitting a string into a slice in golang
Splitting a String into a Slice in Golang | Boot.dev
April 15, 2021 - The Split function takes a string and a delimiter as parameters and returns a slice of strings where each substring was formally separated by the given delimiter.
🌐
gosamples
gosamples.dev › tutorials › basics › 8 ways to split a string in go with examples
8 ways to split a string in Go with examples · GOSAMPLES
December 22, 2025 - To split a string in Go into output substrings containing a separator and getting at most n substrings, use the strings.SplitAfterN() function. It splits a string after each occurrence of the delimiter, and the last substring will be the unsplit remainder. The function signature: func ...
🌐
Codecademy
codecademy.com › docs › go › strings › fields()
Go | Strings | Fields() | Codecademy
July 11, 2023 - The Fields() function in Go is used to split a string into substrings based on whitespace and return a slice of the substrings. It removes any leading or trailing whitespace and treats consecutive whitespace characters as a single separator.
🌐
GeeksforGeeks
geeksforgeeks.org › go language › strings-splitn-function-in-golang-with-examples
strings.SplitN() Function in Golang with Examples - GeeksforGeeks
April 28, 2025 - strings.SplitN() Function() is a string manipulation function in Go language. It is used to split a given string into substrings separated by a separator.
🌐
TutorialsPoint
tutorialspoint.com › strings-split-function-in-golang
Go - Split String
March 10, 2022 - It demonstrates splitting 'p' by the characters 'n' and 's', 'q' by the substring "Lang", and 'p' by each individual character. package main import ( "fmt" "strings" "regexp" ) func main() { // Intializing the Strings p := "oopsfunctions" q := "GoLang language" // Display the Strings fmt.Println("String 1:", p) fmt.Println("String 2:", q) // Using the Split Function and regexp r := regexp.MustCompile(`[ns]`) s := r.Split(p, -2) t := strings.Split(q, "Lang") u := strings.Split(p, "") // Display the Split Output fmt.Println("Split String 1: ", s) fmt.Println("Split String 2: ", t) fmt.Println("Split String 1 with delimiter:", u) }
🌐
GoLinuxCloud
golinuxcloud.com › home › programming › split a string in go: strings.split, fields, cut, and splitn
Go split string, strings.Split, Fields, Cut, SplitN
December 25, 2022 - Cut is ideal when you only need to split once on the first separator and want two parts plus a found bool; SplitN is better when you need n-way splitting with the remainder in the last element. n less than zero returns all substrings; n zero returns nil; n positive caps how many substrings, with the remainder in the last element. ... Proficient in Golang, Python, Java, MongoDB, Selenium, Spring Boot, Kubernetes, Scrapy, API development, Docker, Data Scraping, PrimeFaces, Linux, Data Structures, and Data Mining.
🌐
IncludeHelp
includehelp.com › golang › strings-split-function-with-examples.aspx
Golang strings.Split() Function with Examples
August 19, 2021 - The return type of Split() function is a []string, it returns a slice of the substrings between those separators. // Golang program to demonstrate the // example of strings.Split() Function package main import ( "fmt" "strings" ) func main() { fmt.Printf("%q\n", strings.Split("The sun is very ...
🌐
Code Dodle
codedodle.com › home › tutorials › 4 ways to split string into subtrings in go
4 Ways to Split String into Subtrings in Go - Code Dodle
November 9, 2022 - In this tutorial, I’ll share with you four ways to split a string into a slice of substrings in Go. We’ll be using these 4 functions from Go’s strings package for the slicing task:- func Split(s, sep string) []string func SplitN(s, sep string, n int) []string func SplitAfter(s, sep string) []string func SplitAfterN(s, sep string,...