Compare Strings

Examples Filter
package main

import (
	"fmt"
	"strings"
)

func main() {
	fmt.Println(strings.Compare("a", "b"))
	fmt.Println(strings.Compare("a", "a"))
	fmt.Println(strings.Compare("b", "a"))
}
var s1 = "World";
var s2 = "Hello";
console.log(s1.localeCompare(s2));
console.log(s1.localeCompare('Z'));
console.log(s1.localeCompare('World'));