Created
August 8, 2019 22:44
-
-
Save parzibyte/cd6e80362d23e281350d914b3998b583 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
/* | |
Separar una cadena usando un delimitador | |
de varios caracteres | |
en Go; a través de la función Split | |
https://parzibyte.me/blog | |
*/ | |
import ( | |
"fmt" | |
"strings" | |
) | |
func main() { | |
cadena := "--Hola--Mundo--Ejemplo--Parzibyte.me" | |
delimitador := "--" | |
arreglo := strings.Split(cadena, delimitador) | |
for _, separado := range arreglo { | |
fmt.Println(separado) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment