Skip to content

Latest commit

 

History

History
32 lines (21 loc) · 1.03 KB

string_contains.md

File metadata and controls

32 lines (21 loc) · 1.03 KB

Home > Community Toolbox Reference > String utilities

string_contains

Go to source

Checks whether the given string contains the substring or not. Always returns true for an empty substringg.

Arguments
Argument Type Usage Description
str String Required The string to find the substring in.
substr String Required The string to check.
Returns

Bool

Example

The following example checks for an existence of a cuss word in the player name, and logs a message if one is found.

var _player_name = "Noname";
if (string_contains(_player_name, "cuss")) {
    show_debug_message("Indecent name entered! Please select another one...");
}

Update history

  • 24.6.0 - Created a function to check whether a given string contains the given substring.