You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 lines
607 B

## vowels-index
### Instructions
Write a function that takes one argument of type string and returns an array of integers containing the index of the vowels in the string.
2 years ago
- vowels: [a, e, i, o, u]
### Expected function
```go
func VowelsIndex(str string) []int {
}
```
### Usage
Here is a possible program to test your function
```go
package main
import "fmt"
func main() {
2 years ago
res := []string{"student", "hello Iyan","bcdfgh", "wOrld", "","AAEO$o;jw"}
for _, i := range res {
2 years ago
fmt.Println(VowelIdx(i))
}
}
```
And its output :
2 years ago
```console
$ go run .
2 years ago
[2 4]
[1 4 6 8]
[]
[1]
[]
2 years ago
[0 1 2 3 5]
```
2 years ago