Browse Source

PrinAndMiss

DEV-3181-new-go-exercise-printandmiss
zainabdnaya 2 years ago
parent
commit
34823bc4d9
  1. 5
      subjects/printandmiss/README.md

5
subjects/printandmiss/README.md

@ -5,7 +5,8 @@
Write a function called `PrintAndMiss()` that takes a string and an integer and prints a string containing the characters until reaching the integer, then skipping that same number of characters, and repeats until the end of the string.
- Prints the first half followed by newline `\n`.
- if the string is empty retun `Invalid Output`.
- If the string is empty retun `Invalid Output`.
- If the integer is `0` return the string followed by a newline `\n`.
### Expected function
@ -30,6 +31,7 @@ func main() {
fmt.PrintAndMiss("abcdefghijklmnopqrstuvwyz", 3)
fmt.PrintAndMiss("", 3)
fmt.PrintAndMiss("hello you all ! ", 2)
fmt.PrintAndMiss("what is your name?", 0)
}
```
@ -41,4 +43,5 @@ $ go run . | cat -e
abcghimnostuz$
Invalid Output$
heo u ll $
what is your name?$
```
Loading…
Cancel
Save