- OpenTofu 语言
- 函数
- trimprefix
trimprefix
函数
trimprefix
从给定字符串的开头移除指定的 前缀。如果字符串不以该前缀开头,则返回原始字符串。
示例
> trimprefix("helloworld", "hello")
world
> trimprefix("helloworld", "cat")
helloworld
相关函数
trim
移除字符串开头和结尾的字符。trimsuffix
移除字符串末尾的单词。trimspace
移除字符串开头和结尾的所有类型空格。