函数:rtrim 字符串尾部空白字符过滤

函数名称:字符串过滤

函数功能:对字符串尾部空白字符进行过滤

函数方法

st = str:rtrim()

参数 类型 必填 说明
str string 需要过滤空白字符的内容
返回值 类型 说明
st string 过滤后的内容

函数用例

local ts = require("ts")
str = "哈哈,he he,1,3,6  "
--结果 "哈哈,he he,1,3,6"
--删除字符串尾部的空白字符
dialog(str:rtrim(), 0)

名词解析

  • 空白字符包括:空格、制表符 \t 、换行符 \n\r
Copyright 北京帮你玩科技有限公司 2023 all right reserved,powered by Gitbook该文章修订时间: 2024-03-06 17:50:18

results matching ""

    No results matching ""