Returns a number indicating whether a reference string comes before or after or is the same as the given string in sort order.
Route
POST /string/localeCompare
Roles
admin
Parameters
DetailsExampleSchema
Name
Type
Required
Description
referenceStr
string
yes
The reference string to compare
compareString
string
yes
The string against which the referring string is compared
locales
string
no
A string with a BCP 47 language tag, or an array of such strings
options
object
no
Options to pass
Copied to Clipboard
{
"referenceStr": "ad sed in deserunt",
"compareString": "dolor cupidatat",
"locales": "sed",
"options": null
}
Copied to Clipboard
{
"type": "object",
"properties": {
"referenceStr": {
"description": "The reference string to compare",
"type": "string"
},
"compareString": {
"description": "The string against which the referring string is compared",
"type": "string"
},
"locales": {
"description": "A string with a BCP 47 language tag, or an array of such strings",
"type": "string"
},
"options": {
"description": "Options to pass",
"type": "object",
"properties": {},
"required": [
"options"
],
"additionalProperties": false
}
},
"required": [
"referenceStr",
"compareString"
],
"additionalProperties": false
}
Return
DetailsExampleSchema
Name
Type
Description
compareResult
number
Negative number if the reference string occurs before the compare string; positive if the reference string occurs after the compare string; 0 if they are equivalent
Copied to Clipboard
65306207
Copied to Clipboard
{
"description": "Negative number if the reference string occurs before the compare string; positive if the reference string occurs after the compare string; 0 if they are equivalent",
"type": "integer"
}