GSC reference › Built-in
StrEndsWith()
Built-in (engine)
Server + client
Utility
Returns true/false if <string> ends with <substring>. Case sensitive.
Signature
StrEndsWith(<string>, <substring>)
Parameters
| Name | Required? | Details |
|---|---|---|
| string | Required | String to search |
| substring | Required | Substring to search with. |
Returns
Returns true/false if <string> ends with <substring>.
Example (from Treyarch's docs)
ends_with = StrEndsWith( "my_string", "_string" )
Real uses in BO3's scripts
Called 22 times in the decompiled scripts. A few, zombies first:
- scripts/shared/scene_shared.gsc, line 3874
if(is_looping() || strendswith(_str_mode, "loop")) - scripts/shared/util_shared.gsc, line 5407
if(strendswith(str, "_lh")) - scripts/shared/vehicle_shared.gsc, line 3884
if(isdefined(str_targetname) && strendswith(str_targetname, "_ai")) - scripts/shared/vehicleriders_shared.csc, line 80
if(strendswith(fieldname, "_enter")) - scripts/shared/vehicles/_raps.gsc, line 1249
if(isdefined(str_vehicletype) && strendswith(str_vehicletype, "_player"))
Related built-ins
- StrStartsWith()Returns true/false if <string> starts with <substring>.
- PlaySoundWithNotify()Play the sound alias as if coming from the entity
- GetWeaponWithAttachments()Get the requested weapon object
- EnableFrontendStreamingOverlay()Enable or disable the draw of an alternate draw mode for high detail entities marked to use alt draw
- ResetVisibilityCacheWithinRadius()Reset the viscache for sentients within the specified radius
- CollideWithActors()Toggles collision with other actors.
- MeleeWithOffset()Makes this actor melee attack.
- array()Create an array
- Assert()Assert that the given statement is correct.
- GetDvarInt()Gets the value of a dvar.
- IsArray()Checks whether this entity/variable is an array
- GetDvarString()Gets the value of a dvar.
New to GSC?
Start with the basics, or paste a compile error to get the fix.
Built-in descriptions, parameters and examples come from Treyarch's BO3 mod tools docs. Usage links point at shiversoftdev/t7-source (decompiled BO3 scripts).