Golang strings.ContainsRune() function example

package strings

Golang strings.ContainsRune() function usage example

 package main

 import (
  "fmt"
  "strings"
 )

 func main() {
  ok := strings.ContainsRune("Hello World!", 'e')

  fmt.Println("Hello World contains the rune e :", ok)

  ok = strings.ContainsRune("Hello World!", '제')

  fmt.Println("Hello World contains the rune 제 :", ok)
 }

Reference :

http://golang.org/pkg/strings/#ContainsRune

Advertisement