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