github.com/shogo82148/std@v1.22.1-0.20240327122250-4e474527810c/strings/compare.go (about) 1 // Copyright 2015 The Go Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 package strings 6 7 // Compareは、2つの文字列を辞書順で比較して整数を返します。 8 // a == bの場合は0、a < bの場合は-1、a > bの場合は+1になります。 9 // 10 // Compareは、パッケージbytesとの対称性のために含まれています。 11 // 通常、組み込みの文字列比較演算子==、<、>などを使用する方が明確で、常に高速です。 12 func Compare(a, b string) int