函数:ltrim 字符串首部空白字符过滤

函数名称:字符串分割过滤

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

函数方法

str = str:ltrim()

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

函数用例

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

名词解析

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

results matching ""

    No results matching ""