函数:strSplit 分割字符串

函数名称:分割字符串

函数功能:按照指定字符分割一个字符串为一个表

函数方法

data = strSplit(str,symbol,pos)

参数 类型 必填 说明
str string 要被分割的字符串
symbol string 分割的依据,不填写默认 '@'
pos numebr 起始分割位置,缺省默认值 1
返回值 类型 说明
data table 分割后形成的表

函数用例

require "TSLib"--使用本函数库必须在脚本开头引用并将文件放到设备 lua 目录下
str="1@2@3"
symbol="@"
pos=3
data = strSplit(str,symbol,pos)  --data = {1,2,3}
dialog(data[1])
Copyright 北京帮你玩科技有限公司 2023 all right reserved,powered by Gitbook该文章修订时间: 2024-03-06 17:50:18

results matching ""

    No results matching ""