函数:split 字符串分割

函数名称:字符串分割

函数功能:对字符串分割

函数方法

tb = str:split(symbol)

参数 类型 必填 说明
str string 需要分割的内容
symbol string 分割的依据
返回值 类型 说明
tb table 分割形成的表

函数用例

local ts = require("ts")
str = "  哈哈,he he,1,3,6  "
new = str:split(",") --将字符串 str 按照 `,`,分割并返回一个 table
dialog(new[2], 0)
Copyright 北京帮你玩科技有限公司 2023 all right reserved,powered by Gitbook该文章修订时间: 2024-03-06 17:50:18

results matching ""

    No results matching ""