public/subjects/ascii/README.md

39 lines
510 B
Markdown
Raw Permalink Normal View History

2022-06-23 12:10:38 +00:00
## ascii
### Instructions
Write a function that receives a string and returns a slice with the ASCII values of its characters. If the string is empty it should return an empty slice.
2022-06-23 12:10:38 +00:00
### Expected function
```go
func Ascii(str string) []byte {
}
```
### Usage
Here is a possible program to test your function:
```go
package main
import (
"piscine"
"fmt"
)
func main() {
l := piscine.Ascii("Hello")
fmt.Println(l)
}
```
And its output:
```console
$ go run .
[104 101 108 108 111]
```