From 3a26f0a94c5a378ec0930c8496cfdde52ebd2ad6 Mon Sep 17 00:00:00 2001 From: jotapero Date: Thu, 20 Oct 2022 12:35:29 +0100 Subject: [PATCH] docs(reverseSecondHalf): fix subject - fix indentation - fixed console output --- subjects/reversesecondhalf/README.md | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/subjects/reversesecondhalf/README.md b/subjects/reversesecondhalf/README.md index 45b26ba72..94d8ab271 100644 --- a/subjects/reversesecondhalf/README.md +++ b/subjects/reversesecondhalf/README.md @@ -1,9 +1,9 @@ -# reversesecondhalf +## reversesecondhalf ### Instructions -Write a function `ReverseSecondHalf()` that takes a string as an argument and prints the second half reversed. If the length of the string is odd, round it up. +Write a function that takes a `string` as an argument and prints the second half reversed. If the length of the string is odd, round it up. -- Prints the second half reversed followed by newline `\n`. +- Print the second half reversed followed by newline `\n`. - If the string is empty, return `Invalid Output`. - If the string's length equals one, return it, followed by newline `\n`. @@ -11,12 +11,13 @@ Write a function `ReverseSecondHalf()` that takes a string as an argument and pr ```go func ReverseSecondHalf(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 @@ -24,18 +25,18 @@ package main import "fmt" func main() { - fmt.Print(ReverseSecondHalf("This is the 1st half This is the 2nd half")) - fmt.Print(ReverseSecondHalf("")) - fmt.Print(ReverseSecondHalf("Hello World")) + fmt.Print(ReverseSecondHalf("This is the 1st half This is the 2nd half")) + fmt.Print(ReverseSecondHalf("")) + fmt.Print(ReverseSecondHalf("Hello World")) } - ``` -And its output : +And its output: -```go +```console $ go run . | cat -e -flah dn2 eht si sihT$ -Invalid Output$ -dlroW$ +flah dn2 eht si sihT +Invalid Output +dlroW +$ ```