Strings function

package main
import (
    "fmt"
    s "strings"
)
func main() {
    /\* Need to import strings as s \*/
    fmt.Println(s.Contains("test", "e"))
    /\* Build in \*/
    fmt.Println(len("hello"))  // => 5
    // Outputs: 101
    fmt.Println("hello"[1])
    // Outputs: e
    fmt.Println(string("hello"[1]))
}
Comments