<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://hna.wiki/Module:Array?action=history&amp;feed=atom</id>
	<title>Module:Array - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://hna.wiki/Module:Array?action=history&amp;feed=atom"/>
	<link rel="alternate" type="text/html" href="https://hna.wiki/Module:Array?action=history"/>
	<updated>2026-07-14T15:52:20Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.46.0</generator>
	<entry>
		<id>https://hna.wiki/Module:Array?diff=2539&amp;oldid=prev</id>
		<title>Mattk4355 at 05:45, 4 September 2025</title>
		<link rel="alternate" type="text/html" href="https://hna.wiki/Module:Array?diff=2539&amp;oldid=prev"/>
		<updated>2025-09-04T05:45:21Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw-interface=&quot;&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 05:45, 4 September 2025&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l127&quot;&gt;Line 127:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 127:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	-- join as sentence&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	-- join as sentence&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	if sentence ~= nil then&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	if sentence ~= nil then&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;		if #array == 0 then return &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&quot;&quot;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;		if #array == 0 then return &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&#039;&#039;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;		elseif #array == 1 then &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;return &lt;/del&gt;array[1]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;		elseif #array == 1 then &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;result =  &lt;/ins&gt;array[1]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;		elseif #array == 2 then &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;return &lt;/del&gt;array[1] .. sentence_last .. array[2]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;		elseif #array == 2 then &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;result =  &lt;/ins&gt;array[1] .. sentence_last .. array[2]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;		else&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;		else&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;			local last = table.remove(array, #array)&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;			local last = table.remove(array, #array)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l139&quot;&gt;Line 139:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 139:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	-- join with join string&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	-- join with join string&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	else&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	else&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;		&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;if string&lt;/del&gt;.&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;find&lt;/del&gt;(join&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;, &quot;{newline}&quot;&lt;/del&gt;) &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;then&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;		&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;result = table&lt;/ins&gt;.&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;concat&lt;/ins&gt;(&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;array, &lt;/ins&gt;join):gsub(&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&#039;&lt;/ins&gt;{newline}&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&#039;&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&#039;&lt;/ins&gt;\n&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&#039;&lt;/ins&gt;):gsub(&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&#039;&lt;/ins&gt;{space}&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&#039;&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&#039; &#039;&lt;/ins&gt;)&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;--in case joining string contains keyword&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;			join = join&lt;/del&gt;:gsub(&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&quot;&lt;/del&gt;{newline}&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&quot;&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&quot;&lt;/del&gt;\n&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&quot;&lt;/del&gt;)&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;		end&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;		if string.find(join, &quot;{space}&quot;) then&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;			join = join&lt;/del&gt;:gsub(&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&quot;&lt;/del&gt;{space}&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&quot;&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&quot; &quot;)&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;		end&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;		result = table.concat(array, join&lt;/del&gt;)&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	end&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	end&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	result = prefix .. result .. suffix&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	result = prefix .. result .. suffix&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key mediawiki:diff:1.41:old-957:rev-2539:php=table --&gt;
&lt;/table&gt;</summary>
		<author><name>Mattk4355</name></author>
	</entry>
	<entry>
		<id>https://hna.wiki/Module:Array?diff=957&amp;oldid=prev</id>
		<title>919dd: Protected &quot;Module:Array&quot; ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite))</title>
		<link rel="alternate" type="text/html" href="https://hna.wiki/Module:Array?diff=957&amp;oldid=prev"/>
		<updated>2025-08-29T22:06:56Z</updated>

		<summary type="html">&lt;p&gt;Protected &amp;quot;&lt;a href=&quot;/Module:Array&quot; title=&quot;Module:Array&quot;&gt;Module:Array&lt;/a&gt;&amp;quot; ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite))&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw-interface=&quot;&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 22:06, 29 August 2025&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;4&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;!-- diff cache key mediawiki:diff:1.41:old-201:rev-957 --&gt;
&lt;/table&gt;</summary>
		<author><name>919dd</name></author>
	</entry>
	<entry>
		<id>https://hna.wiki/Module:Array?diff=201&amp;oldid=prev</id>
		<title>Kwwxis: Add more features from Array module in zzz/wuwa wikis</title>
		<link rel="alternate" type="text/html" href="https://hna.wiki/Module:Array?diff=201&amp;oldid=prev"/>
		<updated>2025-08-29T11:51:19Z</updated>

		<summary type="html">&lt;p&gt;Add more features from Array module in zzz/wuwa wikis&lt;/p&gt;
&lt;a href=&quot;https://hna.wiki/Module:Array?diff=201&amp;amp;oldid=182&quot;&gt;Show changes&lt;/a&gt;</summary>
		<author><name>Kwwxis</name></author>
	</entry>
	<entry>
		<id>https://hna.wiki/Module:Array?diff=182&amp;oldid=prev</id>
		<title>Sangodono: Created page with &quot;local p = {} local lib = require(&#039;Module:Feature&#039;)  function p.main(frame) 	local args = require(&#039;Module:Arguments&#039;).getArgs(frame, { 		wrapper = { &#039;Template:Array&#039; } 	}) 	--mw.logObject(args,&#039;args&#039;) --debug 	return p._main(args, frame) end  function p._main(args, frame) 	local arrayString = args[1] or nil 	local separator = args[2] or args.delim or nil 	local form = args[3] or args[&#039;format&#039;] or nil 	local join = args[4] or args.join or &#039;&#039; 	local dedupe = args[&#039;dedupe&#039;]...&quot;</title>
		<link rel="alternate" type="text/html" href="https://hna.wiki/Module:Array?diff=182&amp;oldid=prev"/>
		<updated>2025-08-29T11:23:18Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;local p = {} local lib = require(&amp;#039;Module:Feature&amp;#039;)  function p.main(frame) 	local args = require(&amp;#039;Module:Arguments&amp;#039;).getArgs(frame, { 		wrapper = { &amp;#039;Template:Array&amp;#039; } 	}) 	--mw.logObject(args,&amp;#039;args&amp;#039;) --debug 	return p._main(args, frame) end  function p._main(args, frame) 	local arrayString = args[1] or nil 	local separator = args[2] or args.delim or nil 	local form = args[3] or args[&amp;#039;format&amp;#039;] or nil 	local join = args[4] or args.join or &amp;#039;&amp;#039; 	local dedupe = args[&amp;#039;dedupe&amp;#039;]...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;local p = {}&lt;br /&gt;
local lib = require(&amp;#039;Module:Feature&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
function p.main(frame)&lt;br /&gt;
	local args = require(&amp;#039;Module:Arguments&amp;#039;).getArgs(frame, {&lt;br /&gt;
		wrapper = { &amp;#039;Template:Array&amp;#039; }&lt;br /&gt;
	})&lt;br /&gt;
	--mw.logObject(args,&amp;#039;args&amp;#039;) --debug&lt;br /&gt;
	return p._main(args, frame)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p._main(args, frame)&lt;br /&gt;
	local arrayString = args[1] or nil&lt;br /&gt;
	local separator = args[2] or args.delim or nil&lt;br /&gt;
	local form = args[3] or args[&amp;#039;format&amp;#039;] or nil&lt;br /&gt;
	local join = args[4] or args.join or &amp;#039;&amp;#039;&lt;br /&gt;
	local dedupe = args[&amp;#039;dedupe&amp;#039;] or nil&lt;br /&gt;
	local sort = args[&amp;#039;sort&amp;#039;] or nil&lt;br /&gt;
	local sentence = args[&amp;#039;sentence&amp;#039;] or nil&lt;br /&gt;
	local template = args[&amp;#039;template&amp;#039;] or nil&lt;br /&gt;
	local prefix = args[&amp;#039;prefix&amp;#039;] or &amp;#039;&amp;#039;&lt;br /&gt;
	local suffix = args[&amp;#039;suffix&amp;#039;] or &amp;#039;&amp;#039;&lt;br /&gt;
	local sentence_last = args[&amp;#039;sentence_last&amp;#039;] or &amp;#039; and &amp;#039;&lt;br /&gt;
	local sentence_join = args[&amp;#039;sentence_join&amp;#039;] or &amp;#039;, &amp;#039;&lt;br /&gt;
	local sub_separator = args.subsep or nil&lt;br /&gt;
	local split_opt = {&lt;br /&gt;
		removeEmpty = args[&amp;#039;removeEmpty&amp;#039;] or nil,&lt;br /&gt;
		noTrim = args[&amp;#039;noTrim&amp;#039;] or nil&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	-- argument validation&lt;br /&gt;
	if arrayString == nil then return &amp;#039;&amp;#039; end&lt;br /&gt;
	if separator == nil then return error(&amp;#039;Second argument (separator) must not be empty.&amp;#039;) end&lt;br /&gt;
	if separator == &amp;#039;&amp;#039; then return error(&amp;#039;Second argument (separator) must not be empty string.&amp;#039;) end&lt;br /&gt;
	if form == nil then return error(&amp;#039;Third argument (format) must not be empty.&amp;#039;) end&lt;br /&gt;
	if form:find(&amp;#039;{item[%d%.]*}&amp;#039;) == nil then return error(&amp;#039;Third argument (format) does not include {item}.&amp;#039;) end&lt;br /&gt;
&lt;br /&gt;
	-- split string to array&lt;br /&gt;
	local array = lib.split(arrayString, separator, split_opt)&lt;br /&gt;
&lt;br /&gt;
	-- remove duplcates from array&lt;br /&gt;
	if dedupe == &amp;#039;1&amp;#039; then&lt;br /&gt;
		array = p._removeDuplicates(array)&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- sort array&lt;br /&gt;
	if sort ~= nil then&lt;br /&gt;
		array = p._sort(array, sort)&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- replace keywords in array&lt;br /&gt;
	for key, value in pairs(array) do&lt;br /&gt;
		local item = form&lt;br /&gt;
		item = item:gsub(&amp;#039;{newline}&amp;#039;, &amp;#039;\n&amp;#039;)&lt;br /&gt;
		item = item:gsub(&amp;#039;{index}&amp;#039;, key)&lt;br /&gt;
		&lt;br /&gt;
		-- figure out sub-divisions if any&lt;br /&gt;
		function split(arr, index)&lt;br /&gt;
			if args[&amp;#039;delim&amp;#039; .. index] then&lt;br /&gt;
				for v in lib.gsplit(arr.main, args[&amp;#039;delim&amp;#039; .. index], split_opt) do&lt;br /&gt;
					local subarr = {main = v}&lt;br /&gt;
					split(subarr, tostring(tonumber(index)+1))&lt;br /&gt;
					table.insert(arr, subarr)&lt;br /&gt;
				end&lt;br /&gt;
			else&lt;br /&gt;
				return&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
		local values = { main = value }&lt;br /&gt;
		split(values, &amp;#039;2&amp;#039;)&lt;br /&gt;
		&lt;br /&gt;
		item = item:gsub(&amp;#039;{item}&amp;#039;, value)&lt;br /&gt;
		item = item:gsub(&amp;#039;{item([%d%.]*)}&amp;#039;,&lt;br /&gt;
			function(suffix)&lt;br /&gt;
				local val = values&lt;br /&gt;
				for index in lib.gsplit(suffix, &amp;#039;.&amp;#039;) do&lt;br /&gt;
					if val[tonumber(index)] then&lt;br /&gt;
						val = val[tonumber(index)]&lt;br /&gt;
					else&lt;br /&gt;
						val = {main=&amp;#039;&amp;#039;}&lt;br /&gt;
						break&lt;br /&gt;
					end&lt;br /&gt;
				end&lt;br /&gt;
				return val.main&lt;br /&gt;
			end&lt;br /&gt;
		)&lt;br /&gt;
		&lt;br /&gt;
		array[key] = item&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	if args.debug then mw.logObject(array, &amp;#039;input array&amp;#039;) end&lt;br /&gt;
	&lt;br /&gt;
	-- create result array&lt;br /&gt;
	local result = &amp;#039;&amp;#039;&lt;br /&gt;
	&lt;br /&gt;
	-- join as sentence&lt;br /&gt;
	if sentence ~= nil then&lt;br /&gt;
		if #array == 0 then return &amp;#039;&amp;#039;&lt;br /&gt;
		elseif #array == 1 then result =  array[1]&lt;br /&gt;
		elseif #array == 2 then result =  array[1] .. sentence_last .. array[2]&lt;br /&gt;
		else&lt;br /&gt;
			local last = table.remove(array, #array)&lt;br /&gt;
			result = table.concat(array, sentence_join) .. &amp;#039;,&amp;#039; .. sentence_last .. last&lt;br /&gt;
		end&lt;br /&gt;
	-- join with join string&lt;br /&gt;
	else&lt;br /&gt;
		result = table.concat(array, join):gsub(&amp;#039;{newline}&amp;#039;, &amp;#039;\n&amp;#039;):gsub(&amp;#039;{space}&amp;#039;, &amp;#039; &amp;#039;)--in case joining string contains keyword&lt;br /&gt;
	end&lt;br /&gt;
	result = prefix .. result .. suffix&lt;br /&gt;
	if template then&lt;br /&gt;
		if args.debug then mw.logObject(result, &amp;#039;final result pre-preprocess&amp;#039;) end&lt;br /&gt;
		if not args.nodpl then&lt;br /&gt;
			result = result&lt;br /&gt;
				:gsub(&amp;#039;²{&amp;#039;,&amp;#039;{{&amp;#039;)&lt;br /&gt;
				:gsub(&amp;#039;}²&amp;#039;,&amp;#039;}}&amp;#039;)&lt;br /&gt;
				:gsub(&amp;#039;¦&amp;#039;,&amp;#039;|&amp;#039;)&lt;br /&gt;
		end&lt;br /&gt;
		result = result&lt;br /&gt;
			:gsub(&amp;#039;%^2{&amp;#039;,&amp;#039;{{&amp;#039;)	-- for use inside DPL&lt;br /&gt;
			:gsub(&amp;#039;}%^2&amp;#039;,&amp;#039;}}&amp;#039;)	--&lt;br /&gt;
			:gsub(&amp;#039;¹&amp;#039;,&amp;#039;|&amp;#039;)		--&lt;br /&gt;
		result = frame:preprocess(result)&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	if args.debug then mw.logObject(result, &amp;#039;final result&amp;#039;) end&lt;br /&gt;
	&lt;br /&gt;
	return result&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p._removeDuplicates(arr)&lt;br /&gt;
	local hash = {}&lt;br /&gt;
	local res = {}&lt;br /&gt;
&lt;br /&gt;
	for _,v in ipairs(arr) do&lt;br /&gt;
	   if (not hash[v]) then&lt;br /&gt;
	       res[#res+1] = v&lt;br /&gt;
	       hash[v] = true&lt;br /&gt;
	   end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	return res&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p._sort(arr, dir)&lt;br /&gt;
	local order = nil&lt;br /&gt;
	if (dir == -1 or dir == &amp;#039;-1&amp;#039;) then&lt;br /&gt;
		order = function(tVal, a, b) return a &amp;gt; b end&lt;br /&gt;
	elseif (dir == 1 or dir == &amp;#039;1&amp;#039;) then&lt;br /&gt;
		order = function(tVal, a, b) return a &amp;lt; b end&lt;br /&gt;
	else&lt;br /&gt;
		return arr&lt;br /&gt;
	end&lt;br /&gt;
	table.sort(arr, function(a, b) return order(t, a, b) end)&lt;br /&gt;
	return arr&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Sangodono</name></author>
	</entry>
</feed>