mirror of https://github.com/01-edu/public.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
538 B
36 lines
538 B
2 years ago
|
## remove-odd
|
||
|
|
||
|
### Instructions
|
||
|
|
||
|
Write a function named `RemoveOdd(string)` that takes a string and returns a new string with all the odd characters removed.
|
||
|
- The function should skip spaces.
|
||
|
|
||
|
### Expected function
|
||
|
```go
|
||
|
func RemoveOdd(string) string{
|
||
|
// your code here
|
||
|
}
|
||
|
```
|
||
|
|
||
|
### Usage
|
||
|
|
||
|
``` go
|
||
|
package main
|
||
|
|
||
|
import "fmt"
|
||
|
|
||
|
func main(){
|
||
|
fmt.Println(RemoveOdd("Hello World"))
|
||
|
fmt.Println(RemoveOdd("H"))
|
||
|
fmt.Println(RemoveOdd("How are you?"))
|
||
|
}
|
||
|
```
|
||
|
|
||
|
and the output should be:
|
||
|
|
||
|
```console
|
||
|
$ go run .
|
||
|
Hlo Wrd
|
||
|
H
|
||
|
Hw ae yu
|
||
|
```
|