mirror of https://github.com/01-edu/public.git
jrosendo
2 years ago
committed by
José Rosendo
1 changed files with 37 additions and 0 deletions
@ -0,0 +1,37 @@
|
||||
## checknumber |
||||
|
||||
### Instructions |
||||
|
||||
Write a function that takes a `string` as an argument and returns `true` if the string contains any number, otherwise return `false`. |
||||
|
||||
### Expected function |
||||
|
||||
```go |
||||
func CheckNumber(arg string) bool { |
||||
} |
||||
``` |
||||
|
||||
### Usage |
||||
|
||||
Here is a possible program to test your function: |
||||
|
||||
```go |
||||
package main |
||||
import ( |
||||
"fmt" |
||||
"piscine" |
||||
) |
||||
func main() { |
||||
fmt.Println(piscine.CheckNumber("Hello")) |
||||
fmt.Println(piscine.CheckNumber("Hello1")) |
||||
} |
||||
``` |
||||
|
||||
And its output: |
||||
|
||||
```console |
||||
$ go run . |
||||
false |
||||
true |
||||
$ |
||||
``` |
Loading…
Reference in new issue