# String Compare
Grammar — Compares s1 to s2 (sens|Sensitive/Insensitive to case)
Flags —Native
|Function
Returns 0 if the two strings are the same. Positive value means first character that doesn*“t match is greater in String1. Negative means it”*s greater in String2.
# Arguments
string
— String 1string
— String 2bool
[ preset::String_Case_Sensitivity ] — Sensitivity
Returns — int
native int StringCompare(
string s1,
string s2,
bool caseSens,
);
# Related
Category: String / Comparisons
- [F] —
bool
— String Equal — ( StringEqual ) - [F] —
int
— String Compare — ( StringCompare ) - [F] —
int
— String Length — ( StringLength )
# Examples
# mods/heroes.stormmod
// L772
StringCompare(lv_heroStringIDs, "Cho", c_stringNoCase)
// L772
StringCompare(lv_heroStringIDs, "Gall", c_stringNoCase)
// L778
StringCompare(lv_heroStringIDs, (gv_pLAYER_AI_AllyHero), c_stringNoCase)
// L814
StringCompare(lv_heroStringIDs, "Cho", c_stringNoCase)
// L814
StringCompare(lv_heroStringIDs, "Gall", c_stringNoCase)
// L820
StringCompare(lv_heroStringIDs, (gv_pLAYER_AI_EnemyHero), c_stringNoCase)
// L772
StringCompare(lv_heroStringIDs, "Cho", c_stringNoCase)
// L772
StringCompare(lv_heroStringIDs, "Gall", c_stringNoCase)
// L778
StringCompare(lv_heroStringIDs, (gv_pLAYER_AI_AllyHero), c_stringNoCase)
// L814
StringCompare(lv_heroStringIDs, "Cho", c_stringNoCase)
// L814
StringCompare(lv_heroStringIDs, "Gall", c_stringNoCase)
// L820
StringCompare(lv_heroStringIDs, (gv_pLAYER_AI_EnemyHero), c_stringNoCase)
# mods/heroesdata.stormmod
// L7766
StringCompare(StringWord(EventChatMessage(false), 1), EventChatMessage(true), c_stringNoCase)
// L8067
StringCompare(StringWord(EventChatMessage(false), 1), EventChatMessage(true), c_stringNoCase)
// L8078
StringCompare(EventChatMessage(false), EventChatMessage(true), c_stringNoCase)
// L8234
StringCompare(StringWord(lv_enteredString, 1), EventChatMessage(true), c_stringNoCase)
// L8317
StringCompare(StringWord(EventChatMessage(false), 1), EventChatMessage(true), c_stringNoCase)
# mods/heroesmapmods/battlegroundmapmods/battlefieldofeternity.stormmod
// L3174
StringCompare(StringWord(EventChatMessage(false), 1), EventChatMessage(true), c_stringNoCase)
# mods/heroesmapmods/battlegroundmapmods/warheadjunction.stormmod
// L2386
StringCompare(StringWord(EventChatMessage(false), 1), EventChatMessage(true), c_stringNoCase)
// L2430
StringCompare(StringWord(EventChatMessage(false), 1), EventChatMessage(true), c_stringNoCase)
# mods/warcoop/warcoopdata.sc2mod
// L416
StringCompare(lv_character, "0", c_stringCase)
// L416
StringCompare(lv_character, "9", c_stringCase)