跳至主要内容

trimsuffix 函数

trimsuffix 从给定字符串的末尾移除指定的字尾。

示例

代码块
> trimsuffix("helloworld", "world")
hello
  • trim 移除字符串开头和结尾的字符。
  • trimprefix 从字符串开头移除一个单词。
  • trimspace 从字符串开头和结尾移除所有类型的空白字符。