From 8fe110be637053a8a51d728373e2e7bd4e2225b3 Mon Sep 17 00:00:00 2001 From: zainabdnaya Date: Sat, 30 Jul 2022 02:26:02 +0100 Subject: [PATCH] PrinAndMiss --- subjects/printandmiss/README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/subjects/printandmiss/README.md b/subjects/printandmiss/README.md index 97d1821fc..1f8ce8023 100644 --- a/subjects/printandmiss/README.md +++ b/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?$ ``` \ No newline at end of file