From 05fc779522832a4f8cbdb01b327af61faca524e2 Mon Sep 17 00:00:00 2001 From: Augusto Date: Wed, 2 Oct 2019 22:40:07 +0100 Subject: [PATCH] split program --- subjects/splitprog.en.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 subjects/splitprog.en.md diff --git a/subjects/splitprog.en.md b/subjects/splitprog.en.md new file mode 100644 index 000000000..cea8a5787 --- /dev/null +++ b/subjects/splitprog.en.md @@ -0,0 +1,24 @@ +## splitprog + +### Instructions + +Write a program that separates the words of a `string` and puts them in a `string` array and then prints it to standard output. + +- The program receives two parameters: + + - The first parameter is the `string` + - The second parameter is the `separator` + +### Expected output : + +```console +student@ubuntu:~/piscine-go/splitprog$ go build +student@ubuntu:~/piscine-go/splitprog$ ./splitprog "HelloHAhowHAareHAyou?" HA +[Hello how are you?] +student@ubuntu:~/piscine-go/splitprog$ ./splitprog "Hello,how,are,you?" "," +[Hello how are you?] +student@ubuntu:~/piscine-go/splitprog$ ./splitprog "HelloHAhowHAareHAyou?" +student@ubuntu:~/piscine-go/splitprog$ +student@ubuntu:~/piscine-go/splitprog$ ./splitprog +student@ubuntu:~/piscine-go/splitprog$ +```