- OpenTofu 语言
- 函数
- endswith
endswith
函数
endswith
接受两个值:要检查的字符串和后缀字符串。如果第一个字符串以该确切后缀结尾,则该函数返回 true。
endswith(string, suffix)
示例
> endswith("hello world", "world")
true
> endswith("hello world", "hello")
false
相关函数
startswith
接受两个值:要检查的字符串和前缀字符串。如果字符串以该确切前缀开头,则该函数返回 true。