mirror of https://github.com/01-edu/public.git
Tiago Collot
2 years ago
1 changed files with 43 additions and 0 deletions
@ -0,0 +1,43 @@
|
||||
# jumpover |
||||
|
||||
### Instructions |
||||
|
||||
Write a function `jumpover` that takes a string and returns another string with every third character. |
||||
|
||||
- Prints the output followed by newline `\n`. |
||||
- If the string is empty, return newline `\n`. |
||||
- If there is no third character, return newline `\n`. |
||||
|
||||
### Expected function |
||||
|
||||
```go |
||||
func JumpOver(str string) string { |
||||
} |
||||
``` |
||||
|
||||
### Usage |
||||
|
||||
Here is a possible program to test your function : |
||||
|
||||
```go |
||||
package main |
||||
|
||||
import "fmt" |
||||
|
||||
func main() { |
||||
fmt.Print(JumpOver("1010101010")) |
||||
fmt.Print(JumpOver("")) |
||||
fmt.Print(JumpOver("t w e l v e")) |
||||
fmt.Print(JumpOver("12")) |
||||
} |
||||
``` |
||||
|
||||
And its output : |
||||
|
||||
```go |
||||
$ go run . | cat -e |
||||
101$ |
||||
$ |
||||
w v$ |
||||
$ |
||||
``` |
Loading…
Reference in new issue