# String Compare

Grammar — Compares s1 to s2 (sens|Sensitive/Insensitive to case)
FlagsNative | 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

Returns — int

native int StringCompare(
	string s1,
	string s2,
	bool caseSens,
);

Category: String / Comparisons

# Examples

# mods/heroes.stormmod

MapScript.galaxy

// 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

SupportLib.galaxy

// 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

LibMLBD.galaxy

// L3174
StringCompare(StringWord(EventChatMessage(false), 1), EventChatMessage(true), c_stringNoCase)

# mods/heroesmapmods/battlegroundmapmods/warheadjunction.stormmod

LibMSC2.galaxy

// L2386
StringCompare(StringWord(EventChatMessage(false), 1), EventChatMessage(true), c_stringNoCase)
// L2430
StringCompare(StringWord(EventChatMessage(false), 1), EventChatMessage(true), c_stringNoCase)

# mods/warcoop/warcoopdata.sc2mod

WarCoopData.galaxy

// L416
StringCompare(lv_character, "0", c_stringCase)
// L416
StringCompare(lv_character, "9", c_stringCase)