# String Containment
Grammar — s1 contains s2 at loc (sens|Sensitive/Insensitive to case)
Flags —Native
|Function
Checks if a string can be found within another string and returns true if present and false if not present.
# Arguments
string
— String 1string
— String 2int
[ preset::String_Contain_Location ] — Locationbool
[ preset::String_Case_Sensitivity ] — Sensitivity
Returns — bool
native bool StringContains(
string s1,
string s2,
int location,
bool caseSens,
);
# Related
Category: String / Substrings
- [F] —
string
— Word Of String — ( StringWord ) - [F] —
string
— Substring — ( StringSub ) - [F] —
int
— Position Of Substring — ( StringFind ) - [F] —
bool
— String Containment — ( StringContains ) - [F] —
string
— String With Indexed Replacement — ( StringReplace ) - [F] —
string
— String With Search Replacement — ( StringReplaceWord ) - [F] —
text
— Text With Search Replacement — ( TextReplaceWord )
# Examples
# campaigns/liberty.sc2campaign
// L19094
StringContains(lv_roomname, "Armory", c_stringAnywhere, c_stringNoCase)
// L19097
StringContains(lv_roomname, "Bridge", c_stringAnywhere, c_stringNoCase)
// L19100
StringContains(lv_roomname, "Cantina", c_stringAnywhere, c_stringNoCase)
// L19103
StringContains(lv_roomname, "Char", c_stringAnywhere, c_stringNoCase)
// L19106
StringContains(lv_roomname, "Lab", c_stringAnywhere, c_stringNoCase)
// L19109
StringContains(lv_roomname, "MarSara", c_stringAnywhere, c_stringNoCase)
// L19094
StringContains(lv_roomname, "Armory", c_stringAnywhere, c_stringNoCase)
// L19097
StringContains(lv_roomname, "Bridge", c_stringAnywhere, c_stringNoCase)
// L19100
StringContains(lv_roomname, "Cantina", c_stringAnywhere, c_stringNoCase)
// L19103
StringContains(lv_roomname, "Char", c_stringAnywhere, c_stringNoCase)
// L19106
StringContains(lv_roomname, "Lab", c_stringAnywhere, c_stringNoCase)
// L19109
StringContains(lv_roomname, "MarSara", c_stringAnywhere, c_stringNoCase)
# campaigns/voidstory.sc2campaign
// L530
StringContains(lp_name, libNtve_gf_DialogItemEditValue(libVCST_gv_pS_DebugStoryFilterEditBox, 1), c_stringAnywhere, c_stringNoCase)
# mods/missionpacks/novacampaign.sc2mod
// L474
StringContains(lp_name, libNtve_gf_DialogItemEditValue(libNCST_gv_nS_DebugStoryFilterEditBox, 1), c_stringAnywhere, c_stringNoCase)
# mods/starcoop/starcoop.sc2mod
// L30102
StringContains((lv_itReward), ("_" + (libCOOC_gf_ActiveCommanderForPlayer(1))), c_stringAnywhere, c_stringCase)
# mods/warcoop/warclassic.sc2mod
// L82
StringContains(set,entry,c_stringAnywhere,c_stringCase)
# mods/warcoop/warclassicsystem.sc2mod
// L123
StringContains((lv_itEntry), lv_raceToken, c_stringEnd, c_stringCase)
# mods/warcoop/warcoopdata.sc2mod
// L2105
StringContains((lv_itEntry), lv_raceToken, c_stringEnd, c_stringCase)
// L3723
StringContains(EventChatMessage(false), "thrall lives", c_stringAnywhere, c_stringNoCase)