public/subjects/evenlength
estlop 5ab429e996 docs: Explain what to do when slice is empty or there are no even elements as per review
docs: remove piscine imports and refactor to remove variable as per review
2022-07-14 10:33:49 +03:00
..
README.md docs: Explain what to do when slice is empty or there are no even elements as per review 2022-07-14 10:33:49 +03:00

README.md

evenlength

Instructions

Write a function that receives a slice of strings and returns a new slice with the strings in which the length is even. When the slice is empty or there are no even strings return an empty slice.

Expected function

func EvenLength(strings []string) []string {
}

Usage

Here is a possible program to test your function:

package main

import "fmt"

func main() {
    fmt.Println(EvenLength([]string{"Hi", "Hola", "Ola", "Ciao", "Salut", "Hallo"}))
}

And its output:

$ go run .
[Hi Hola Ciao]