Browse Source

docs(stringtointslice): Rename file and rename README.md functions to stringtointslice

DEV-3376-pointers-drop-the-thread-multiple-issues
Tiago Collot 2 years ago
parent
commit
abe64ca1b3
  1. 16
      subjects/stringtointslice/README.md

16
subjects/stringtointarray/README.md → subjects/stringtointslice/README.md

@ -1,13 +1,13 @@
## stringtointarray ## stringtointslice
### Instructions ### Instructions
Write a function `StringToIntArray()` that takes a `string` and returns the corresponding `int` array. Write a function `StringToIntSlice()` that takes a `string` and returns the corresponding `int` slice.
### Expected function ### Expected function
```go ```go
func StringToIntArray(str string) []int { func StringToIntSlice(str string) []int {
} }
``` ```
@ -20,14 +20,14 @@ Here is a possible program to test your function:
package main package main
import ( import (
"fmt" "fmt"
"piscine" "piscine"
) )
func main() { func main() {
fmt.Println(piscine.StringToIntArray("A quick brown fox jumps over the lazy dog")) fmt.Println(piscine.StringToIntSlice("A quick brown fox jumps over the lazy dog"))
fmt.Println(piscine.StringToIntArray("Converted this string into an int")) fmt.Println(piscine.StringToIntSlice("Converted this string into an int"))
fmt.Println(piscine.StringToIntArray("hello THERE")) fmt.Println(piscine.StringToIntSlice("hello THERE"))
} }
``` ```
Loading…
Cancel
Save