Browse Source

docs(printfirsthalf): instructions upgrade

DEV-3175-new-go-exercise-printfirsthalf
Tiago Collot 2 years ago
parent
commit
6d6bb22205
  1. 9
      subjects/printfirsthalf/README.md

9
subjects/printfirsthalf/README.md

@ -2,12 +2,11 @@
### Instructions
Write a function called `PrintFirstHalf()` that takes a `string` as an argument and returns printed the first half of a `string`.
Write a function called `PrintFirstHalf()` that takes a `string` as an argument and prints the first half of a `string` followed by a newline `\n`.
- If the length of the `string` is odd round it down.
- Prints the first half followed by a newline `\n`.
- If the `string` is empty, return `Invalid Output`, followed by a newline `\n`.
- If the `string` length is equal to one, return it, followed by a newline `\n`.
- If the length of the `string` is odd, round it down.
- If the `string` is empty, return `Invalid Output` followed by a newline `\n`.
- If the `string` length is equal to one, return the `string` followed by a newline `\n`.
### Expected function

Loading…
Cancel
Save