Browse Source

PrinAndMiss

pull/1513/head
zainabdnaya 2 years ago committed by Michele
parent
commit
8fe110be63
  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