Available since Version 1.0.
Checks if a string contains a specified substring.
Syntax
String.Contains( input, substring, [ comparisonType ] )Arguments
input(string): The string to be checked.substring(string): The substring to check for within the string.comparisonType(String.StringComparison, optional): The type of string comparison to perform. Defaults toOrdinal.
Return Values
- (boolean):
trueif the string contains the specified substring,falseotherwise.
Examples
local result = String.Contains("I hate the world!", "hate")
if result then
-- Ban the pessimist for spreading negativity!
else
-- They aight.
end