Quick actions

cmd+k|ctrl+k

Navigation

Languages

Strings / Compare strings / Essential Go

Snippet info

Language

Go

Visibility

public

Author

kkowalczyk

Created

2019-03-26T10:12:33Z

Updated

2019-03-26T10:12:33Z

package main

import (
	"fmt"
	"strings"
)

func main() {
	s1 := "gone"
	s2 := "GoNe"
	if strings.EqualFold(s1, s2) {
		fmt.Printf("'%s' is equal '%s' when ignoring case\n", s1, s2)
	} else {
		fmt.Printf("'%s' is not equal '%s' when ignoring case\n", s1, s2)
	}
}
INFO