From f5161c6f3bfe5f809c55a3abb579f11f488fa71c Mon Sep 17 00:00:00 2001 From: hamza Date: Fri, 24 Jun 2022 20:52:53 +0100 Subject: [PATCH] subject(skip-the-line):add readme --- subjects/skiptheline/README.md | 38 ++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 subjects/skiptheline/README.md diff --git a/subjects/skiptheline/README.md b/subjects/skiptheline/README.md new file mode 100644 index 00000000..3d43259a --- /dev/null +++ b/subjects/skiptheline/README.md @@ -0,0 +1,38 @@ +## skip-the-line + +### Instructions + +Write a function that receives a string and a slice of strings. Return a new slice with the given string prepended. + +### Expected function + +```go +func SkipTheLine(s string, slice []string) []string { + // your code here +} +``` + +### Usage + +Here is a possible program to test your function: + +```go +package main + +import "fmt" + +func main() { + fmt.Println(SkipTheLine("Hello", []string{"world"})) + fmt.Println(SkipTheLine("Hello", []string{"","world", "!"})) + fmt.Println(SkipTheLine("Hello", []string{})) +} +``` + +and the output should be: + +```console +$ go run . +[Hello world] +[Hello world !] +[Hello] +``` \ No newline at end of file