From f247c828517cca42ce13e0d62064be176c04b690 Mon Sep 17 00:00:00 2001 From: Tiago Collot Date: Thu, 20 Oct 2022 16:18:07 +0100 Subject: [PATCH] docs(thirdtimeisacharm): fix subject - fix exercise header - upgrade instructions - add missing import 'piscine' - fix console - fix white-spaces and indentation --- subjects/thirdtimeisacharm/README.md | 30 ++++++++++++++++------------ 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/subjects/thirdtimeisacharm/README.md b/subjects/thirdtimeisacharm/README.md index 1ac4b2cc..4fa180fa 100644 --- a/subjects/thirdtimeisacharm/README.md +++ b/subjects/thirdtimeisacharm/README.md @@ -1,40 +1,44 @@ -# thirdtimeisacharm +## thirdtimeisacharm ### Instructions -Write a function `ThirdTimeIsACharm` that takes a string and returns another string with every third character. +Write a function `ThirdTimeIsACharm()` that takes a `string` as an argument 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`. +- Prints the output followed by a newline `\n`. +- If the `string` is empty, return a newline `\n`. +- If there is no third character, return a newline `\n`. ### Expected function ```go func ThirdTimeIsACharm(str string) string { + } ``` ### Usage -Here is a possible program to test your function : +Here is a possible program to test your function: ```go package main -import "fmt" +import ( + "fmt" + "piscine" +) func main() { - fmt.Print(ThirdTimeIsACharm("123456789")) - fmt.Print(ThirdTimeIsACharm("")) - fmt.Print(ThirdTimeIsACharm("a b c d e f")) - fmt.Print(ThirdTimeIsACharm("12")) + fmt.Print(piscine.ThirdTimeIsACharm("123456789")) + fmt.Print(piscine.ThirdTimeIsACharm("")) + fmt.Print(piscine.ThirdTimeIsACharm("a b c d e f")) + fmt.Print(piscine.ThirdTimeIsACharm("12")) } ``` -And its output : +And its output: -```go +```console $ go run . | cat -e 369$ $