string
<p>[TOC]</p>
<h3>字符串分割</h3>
<pre><code>string.split(input, delimiter)</code></pre>
<h3>分割再转换</h3>
<pre><code>string.splitConvert(input, delimiter)</code></pre>
<h3>splitSplitByMore</h3>
<pre><code>string.splitSplitByMore(str, repsArr)</code></pre>
<h3>去除空格</h3>
<pre><code>string.trim(input)</code></pre>
<h3>toItemData</h3>
<pre><code>string.toItemData(str)</code></pre>
<h3>字符串转二维数组</h3>
<pre><code>string.toArray(str)</code></pre>
<pre><code> --[[
字符串转二维数组
str 格式10^10|20^20
返回值 table = {
[1] = {
[1] = 10,
[2] = 10,
},
[2] = {
[1] = 20,
[2] = 20,
}
}
]]</code></pre>
<h3>字符串转数组</h3>
<pre><code>string.toArray1(str)</code></pre>
<pre><code> 字符串转数组
str 格式10|20
返回值 table = {
[1] = 10,
[2] = 20,
}</code></pre>
<h3>转二维数组</h3>
<pre><code>string.toAttrEX(str)</code></pre>
<pre><code>转二位数组,str格式: 3^10|4^20</code></pre>
<h3>k#v字符串转table</h3>
<pre><code>string.toKeyValue(str)</code></pre>
<pre><code>str 3#100
转换后
return {key = 3,value = 100}</code></pre>
<h3>属性二维数组拼接成属性字符串</h3>
<pre><code>string.toAttrStr(array,job)</code></pre>
<pre><code> 属性二维数组拼接成属性字符串
array = {
[1] = {
[1] = 属性ID,
[2] = 属性值,
}
}
返回值 string[属性ID#属性值|属性ID#属性值],如果job有值,则返回 职业#属性ID#属性值|职业#属性ID#属性值</code></pre>