今天是2025年12月17日 第51周 星期三
代人,时大变了。
我们生活在大地上,但我们的梦想超越天空。
變更
跳至導覽
跳至搜尋
← 較舊編輯
模块:String
(檢視原始碼)
於 2022年7月11日 (一) 18:56 的修訂
增加 237 位元組
、
2022年7月11日 (一) 18:56
小
导入13个版本
行 434:
行 434:
if ignore_null_flag == nil then ignore_null_flag = false end
if ignore_null_flag == nil then ignore_null_flag = false end
−
mw.log(no_pattern_flag, ignore_null_flag);
length = mw.ustring.len(input_str)
length = mw.ustring.len(input_str)
--split函數起點
--split函數起點
行 456:
行 455:
end
end
if separ_str_end < separ_str_begin then separ_str_end = separ_str_begin end
if separ_str_end < separ_str_begin then separ_str_end = separ_str_begin end
−
mw.log(separ_str_begin, separ_str_end, iterator)
finded_str = mw.ustring.sub(input_str, iterator, separ_str_begin - 1)
finded_str = mw.ustring.sub(input_str, iterator, separ_str_begin - 1)
if not(mw.text.trim(finded_str) == '' and ignore_null_flag) then
if not(mw.text.trim(finded_str) == '' and ignore_null_flag) then
result[i] = finded_str
result[i] = finded_str
−
mw.log("\"" .. result[i] .. "\"")
i = i + 1
i = i + 1
end
end
行 475:
行 472:
end
end
return result;
return result;
+
end
+
+
--[[
+
join
+
+
Join all non empty arguments together; the first argument is the separator.
+
Usage:
+
{{#invoke:String|join|sep|one|two|three}}
+
]]
+
function str.join(frame)
+
local args = {}
+
local sep
+
for _, v in ipairs( frame.args ) do
+
if sep then
+
if v ~= '' then
+
table.insert(args, v)
+
end
+
else
+
sep = v
+
end
+
end
+
return table.concat( args, sep or '' )
end
end
白龙
行政員
、
使用者查核員
、importer、
介面管理員
、
結構式討論監督員
、
管理員
1,511
次編輯
導覽選單
個人工具
建立帳號
登入
命名空間
模組
討論
變體
視圖
閱讀
檢視原始碼
檢視歷史
更多
搜尋
導覽
首頁
近期變更
隨機頁面
沙盒
互助客棧
QQ交流群
方針與指引
工具
上傳檔案
特殊頁面
可列印版