Compare commits

...

9 Commits

Author SHA1 Message Date
jrosendo 2b4cbb243d docs(thirdtimeisthecharm): grammar fix 2 years ago
Tiago Collot f247c82851 docs(thirdtimeisacharm): fix subject 2 years ago
zainab Dnaya 634d30e7f2
Update README.md 2 years ago
zainab Dnaya f0c4f46cfb
docs (ThirdTimeIsACharm) : add a single quote 2 years ago
zainab Dnaya f5236f8554
docs(ThirdTimeIsACharm) : removing space from main 2 years ago
zainab Dnaya 3d5d905a0a
docs(thirthtimeischarm) : Fixe mistakes after review 2 years ago
zainab Dnaya fcf4e448c9
Update README.md 2 years ago
zainab Dnaya 8e02b56142
Update README.md 2 years ago
zainabdnaya c372e8a77e feat: subject thisrtimeisacharm 2 years ago
  1. 47
      subjects/thirdtimeisacharm/README.md

47
subjects/thirdtimeisacharm/README.md

@ -0,0 +1,47 @@
## thirdtimeisacharm
### Instructions
Write a function `ThirdTimeIsACharm()` that takes a `string` as an argument and returns another `string` with every third character.
- Return 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:
```go
package main
import (
"fmt"
"piscine"
)
func main() {
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:
```console
$ go run . | cat -e
369$
$
b e$
$
```
Loading…
Cancel
Save