Here, We are going to learn about checking unicode point or rune is present in string.We can check this by using ContainsRune() function of strings package in go golang.
Function prototype:
func ContainsRune(str string, r rune) bool
Return value:
ContainsRune() function returns whether the Unicode code point r is within str as true and false value respectively.
Example:
package main
import (
"fmt"
"strings"
)
func main() {
// Finds whether a string contains a particular Unicode code
// point.
// The code point for the lowercase letter "a", for example,
// is 97.
fmt.Println(strings.ContainsRune("aadlik", 97))
fmt.Println(strings.ContainsRune("peek", 97))
}
Output:
true
false
To learn more about golang, Please refer given below link.
https://techieindoor.com/go-lang-tutorial/
References:
https://golang.org/doc/
https://golang.org/pkg/
https://golang.org/pkg/strings/