forked from solstice/solstice
596 B
596 B
string_EndsWith
Check if a string has another string as a suffix.
Arguments
- str (string): the string to check against.
- suffix (string): the suffix to check for.
Returns
hasSuffix (bool): returns true if str has the given suffix as a suffix, otherwise false.
Example
Ground
call !string_EndsWith "file.txt" ".txt" &hasSuffix
println $hasSuffix # true
call !string_EndsWith "file.grnd" ".txt" &hasSuffix
println $hasSuffix # false
Solstice
puts string_EndsWith("file.txt", ".txt") // true
puts string_EndsWith("file.grnd", ".txt") // false