docs(lastword): update provided example to be clearer

This commit is contained in:
nprimo 2024-05-22 10:49:36 +01:00 committed by Harry
parent 1f6f72bf91
commit e3251487b7
2 changed files with 9 additions and 11 deletions

View File

@ -22,15 +22,14 @@ Here is a possible program to test your function :
package main
import (
"fmt"
"piscine"
"github.com/01-edu/z01"
)
func main() {
z01.PrintRune(piscine.LastWord("this ... is sparta, then again, maybe not"))
z01.PrintRune(piscine.LastWord(" "))
z01.PrintRune(piscine.LastWord(" lorem,ipsum "))
fmt.Print(piscine.LastWord("this ... is sparta, then again, maybe not"))
fmt.Print(piscine.LastWord(" lorem,ipsum "))
fmt.Print(piscine.LastWord(" "))
}
```
@ -39,9 +38,9 @@ And its output :
```console
$ go run . | cat -e
not$
$
lorem,ipsum$
$
$
```
### Notions

View File

@ -1,13 +1,12 @@
package main
import (
"fmt"
"piscine"
"github.com/01-edu/z01"
)
func main() {
z01.PrintRune(piscine.LastWord("this ... is sparta, then again, maybe not"))
z01.PrintRune(piscine.LastWord(" "))
z01.PrintRune(piscine.LastWord(" lorem,ipsum "))
fmt.Print(piscine.LastWord("this ... is sparta, then again, maybe not"))
fmt.Print(piscine.LastWord(" lorem,ipsum "))
fmt.Print(piscine.LastWord(" "))
}