<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ko">
	<id>https://wiki.theeum.com/index.php?action=history&amp;feed=atom&amp;title=%EB%AA%A8%EB%93%88%3AString2</id>
	<title>모듈:String2 - 편집 역사</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.theeum.com/index.php?action=history&amp;feed=atom&amp;title=%EB%AA%A8%EB%93%88%3AString2"/>
	<link rel="alternate" type="text/html" href="https://wiki.theeum.com/index.php?title=%EB%AA%A8%EB%93%88:String2&amp;action=history"/>
	<updated>2026-06-03T15:39:21Z</updated>
	<subtitle>이 문서의 편집 역사</subtitle>
	<generator>MediaWiki 1.39.10</generator>
	<entry>
		<id>https://wiki.theeum.com/index.php?title=%EB%AA%A8%EB%93%88:String2&amp;diff=8823&amp;oldid=prev</id>
		<title>HyunJongSu: &quot;모듈:String2&quot; 문서를 보호했습니다 ([편집=관리자만 허용] (무기한) [이동=관리자만 허용] (무기한))</title>
		<link rel="alternate" type="text/html" href="https://wiki.theeum.com/index.php?title=%EB%AA%A8%EB%93%88:String2&amp;diff=8823&amp;oldid=prev"/>
		<updated>2023-06-09T14:37:12Z</updated>

		<summary type="html">&lt;p&gt;&amp;quot;&lt;a href=&quot;/wiki/%EB%AA%A8%EB%93%88:String2&quot; title=&quot;모듈:String2&quot;&gt;모듈:String2&lt;/a&gt;&amp;quot; 문서를 보호했습니다 ([편집=관리자만 허용] (무기한) [이동=관리자만 허용] (무기한))&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&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;ko&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← 이전 판&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;2023년 6월 9일 (금) 23:37 판&lt;/td&gt;
				&lt;/tr&gt;
&lt;!-- diff cache key eumwiki-eumwk_:diff::1.12:old-8822:rev-8823 --&gt;
&lt;/table&gt;</summary>
		<author><name>HyunJongSu</name></author>
	</entry>
	<entry>
		<id>https://wiki.theeum.com/index.php?title=%EB%AA%A8%EB%93%88:String2&amp;diff=8822&amp;oldid=prev</id>
		<title>HyunJongSu: 새 문서: local p = {}   p.upper = function(frame) 	local s = mw.text.trim(frame.args[1] or &quot;&quot;) 	return string.upper(s) end  p.lower = function(frame) 	local s = mw.text.trim(frame.args[1] or &quot;&quot;) 	return string.lower(s) end   p.sentence = function (frame ) 	frame.args[1] = string.lower(frame.args[1]) 	return p.ucfirst(frame) end   p.ucfirst = function (frame ) 	local s =  mw.text.trim( frame.args[1] or &quot;&quot; ) 	local s1 = &quot;&quot; 	-- if it&#039;s a list chop off and (store as s1) everything up to the...</title>
		<link rel="alternate" type="text/html" href="https://wiki.theeum.com/index.php?title=%EB%AA%A8%EB%93%88:String2&amp;diff=8822&amp;oldid=prev"/>
		<updated>2023-06-09T14:37:04Z</updated>

		<summary type="html">&lt;p&gt;새 문서: local p = {}   p.upper = function(frame) 	local s = mw.text.trim(frame.args[1] or &amp;quot;&amp;quot;) 	return string.upper(s) end  p.lower = function(frame) 	local s = mw.text.trim(frame.args[1] or &amp;quot;&amp;quot;) 	return string.lower(s) end   p.sentence = function (frame ) 	frame.args[1] = string.lower(frame.args[1]) 	return p.ucfirst(frame) end   p.ucfirst = function (frame ) 	local s =  mw.text.trim( frame.args[1] or &amp;quot;&amp;quot; ) 	local s1 = &amp;quot;&amp;quot; 	-- if it&amp;#039;s a list chop off and (store as s1) everything up to the...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;새 문서&lt;/b&gt;&lt;/p&gt;&lt;div&gt;local p = {}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
p.upper = function(frame)&lt;br /&gt;
	local s = mw.text.trim(frame.args[1] or &amp;quot;&amp;quot;)&lt;br /&gt;
	return string.upper(s)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
p.lower = function(frame)&lt;br /&gt;
	local s = mw.text.trim(frame.args[1] or &amp;quot;&amp;quot;)&lt;br /&gt;
	return string.lower(s)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
p.sentence = function (frame )&lt;br /&gt;
	frame.args[1] = string.lower(frame.args[1])&lt;br /&gt;
	return p.ucfirst(frame)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
p.ucfirst = function (frame )&lt;br /&gt;
	local s =  mw.text.trim( frame.args[1] or &amp;quot;&amp;quot; )&lt;br /&gt;
	local s1 = &amp;quot;&amp;quot;&lt;br /&gt;
	-- if it&amp;#039;s a list chop off and (store as s1) everything up to the first &amp;lt;li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	local lipos = string.find(s, &amp;quot;&amp;lt;li&amp;gt;&amp;quot; )&lt;br /&gt;
	if lipos then&lt;br /&gt;
		s1 = string.sub(s, 1, lipos + 3)&lt;br /&gt;
		s = string.sub(s, lipos + 4)&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- 한글/한자 등을 포함한 긴 바이트가 포함되어 있으면 무시 처리함&lt;br /&gt;
	if string.find(s, &amp;quot;[^\128-\191][\128-\191]&amp;quot;) then&lt;br /&gt;
		return s1 .. s&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- s1 is either &amp;quot;&amp;quot; or the first part of the list markup, so we can continue&lt;br /&gt;
	-- and prepend s1 to the returned string&lt;br /&gt;
	if string.find(s, &amp;quot;^%[%[[^|]+|[^%]]+%]%]&amp;quot;) then&lt;br /&gt;
		-- this is a piped wikilink, so we capitalise the text, not the pipe&lt;br /&gt;
		local b, c = string.find(s, &amp;quot;|%A*%a&amp;quot;) -- find the first letter after the pipe&lt;br /&gt;
		return s1 .. string.sub(s, 1, c-1) .. string.upper(string.sub(s, c, c)) .. string.sub(s, c+1)&lt;br /&gt;
	end&lt;br /&gt;
	local letterpos = string.find(s, &amp;#039;%a&amp;#039;)&lt;br /&gt;
	if letterpos then&lt;br /&gt;
		local first = string.sub(s, 1, letterpos - 1)&lt;br /&gt;
		local letter = string.sub(s, letterpos, letterpos)&lt;br /&gt;
		local rest = string.sub(s, letterpos + 1)&lt;br /&gt;
		&lt;br /&gt;
		return s1 .. first .. string.upper(letter) .. rest&lt;br /&gt;
	else&lt;br /&gt;
		return s1 .. s&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
p.title = function (frame )&lt;br /&gt;
	-- http://grammar.yourdictionary.com/capitalization/rules-for-capitalization-in-titles.html&lt;br /&gt;
	-- recommended by The U.S. Government Printing Office Style Manual:&lt;br /&gt;
	-- &amp;quot;Capitalize all words in titles of publications and documents,&lt;br /&gt;
	-- except a, an, the, at, by, for, in, of, on, to, up, and, as, but, or, and nor.&amp;quot;&lt;br /&gt;
	local alwayslower = {[&amp;#039;a&amp;#039;] = 1, [&amp;#039;an&amp;#039;] = 1, [&amp;#039;the&amp;#039;] = 1, &lt;br /&gt;
		[&amp;#039;and&amp;#039;] = 1, [&amp;#039;but&amp;#039;] = 1, [&amp;#039;or&amp;#039;] = 1, [&amp;#039;for&amp;#039;] = 1,&lt;br /&gt;
		[&amp;#039;nor&amp;#039;] = 1, [&amp;#039;on&amp;#039;] = 1, [&amp;#039;in&amp;#039;] = 1, [&amp;#039;at&amp;#039;] = 1, [&amp;#039;to&amp;#039;] = 1,&lt;br /&gt;
		[&amp;#039;from&amp;#039;] = 1, [&amp;#039;by&amp;#039;] = 1, [&amp;#039;of&amp;#039;] = 1, [&amp;#039;up&amp;#039;] = 1 }&lt;br /&gt;
	local res = &amp;#039;&amp;#039;&lt;br /&gt;
	local s =  mw.text.trim( frame.args[1] or &amp;quot;&amp;quot; )&lt;br /&gt;
	local words = mw.text.split( s, &amp;quot; &amp;quot;)&lt;br /&gt;
	for i, s in ipairs(words) do&lt;br /&gt;
		s = string.lower( s )&lt;br /&gt;
		if( i &amp;gt; 1 and alwayslower[s] == 1) then&lt;br /&gt;
			-- leave in lowercase&lt;br /&gt;
		else&lt;br /&gt;
			s = mw.getContentLanguage():ucfirst(s)&lt;br /&gt;
		end&lt;br /&gt;
		words[i] = s&lt;br /&gt;
	end&lt;br /&gt;
	return table.concat(words, &amp;quot; &amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-- stripZeros finds the first number and strips leading zeros (apart from units)&lt;br /&gt;
-- e.g &amp;quot;0940&amp;quot; -&amp;gt; &amp;quot;940&amp;quot;; &amp;quot;Year: 0023&amp;quot; -&amp;gt; &amp;quot;Year: 23&amp;quot;; &amp;quot;00.12&amp;quot; -&amp;gt; &amp;quot;0.12&amp;quot;&lt;br /&gt;
p.stripZeros = function(frame)&lt;br /&gt;
	local s = mw.text.trim(frame.args[1] or &amp;quot;&amp;quot;)&lt;br /&gt;
	n = tonumber( string.match( s, &amp;quot;%d+&amp;quot; ) ) or &amp;quot;&amp;quot;&lt;br /&gt;
	s = string.gsub( s, &amp;quot;%d+&amp;quot;, n, 1 )&lt;br /&gt;
	return s&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-- nowiki ensures that a string of text is treated by the MediaWiki software as just a string&lt;br /&gt;
-- it takes an unnamed parameter and trims whitespace, then removes any wikicode&lt;br /&gt;
p.nowiki = function(frame)&lt;br /&gt;
	local str = mw.text.trim(frame.args[1] or &amp;quot;&amp;quot;)&lt;br /&gt;
	return mw.text.nowiki(str)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-- posnq (position, no quotes) returns the numerical start position of the first occurrence&lt;br /&gt;
-- of one piece of text (&amp;quot;match&amp;quot;) inside another (&amp;quot;str&amp;quot;).&lt;br /&gt;
-- It returns nil if no match is found, or if either parameter is blank.&lt;br /&gt;
-- It takes the text to be searched in as the first unnamed parameter, which is trimmed.&lt;br /&gt;
-- It takes the text to match as the second unnamed parameter, which is trimmed and&lt;br /&gt;
-- any double quotes &amp;quot; are stripped out.&lt;br /&gt;
p.posnq = function(frame)&lt;br /&gt;
	local str = mw.text.trim(frame.args[1] or &amp;quot;&amp;quot;)&lt;br /&gt;
	local match = mw.text.trim(frame.args[2] or &amp;quot;&amp;quot;):gsub(&amp;#039;&amp;quot;&amp;#039;, &amp;#039;&amp;#039;)&lt;br /&gt;
	if  str == &amp;quot;&amp;quot; or match == &amp;quot;&amp;quot; then return nil end&lt;br /&gt;
	-- just take the start position&lt;br /&gt;
	local pos = str:find(match, 1, true)&lt;br /&gt;
	return pos&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- split splits text at boundaries specified by separator&lt;br /&gt;
-- and returns the chunk for the index idx (starting at 1)&lt;br /&gt;
-- #invoke:String2 |split |text |separator |index |true/false&lt;br /&gt;
-- #invoke:String2 |split |txt=text |sep=separator |idx=index |plain=true/false&lt;br /&gt;
-- if plain is false/no/0 then separator is treated as a Lua pattern - defaults to plain=true&lt;br /&gt;
p.split = function(frame)&lt;br /&gt;
	local args = frame.args&lt;br /&gt;
	if not(args[1] or args.txt) then args = frame:getParent().args end&lt;br /&gt;
	local txt = args[1] or args.txt or &amp;quot;&amp;quot;&lt;br /&gt;
	if txt == &amp;quot;&amp;quot; then return nil end&lt;br /&gt;
	local sep = (args[2] or args.sep or &amp;quot;&amp;quot;):gsub(&amp;#039;&amp;quot;&amp;#039;, &amp;#039;&amp;#039;)&lt;br /&gt;
	local idx = tonumber(args[3] or args.idx) or 1&lt;br /&gt;
	local plain = (args[4] or args.plain or &amp;quot;true&amp;quot;):sub(1,1)&lt;br /&gt;
	plain = (plain ~= &amp;quot;f&amp;quot; and plain ~= &amp;quot;n&amp;quot; and plain ~= &amp;quot;0&amp;quot;)&lt;br /&gt;
	return mw.text.split( txt, sep, plain )[idx]&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>HyunJongSu</name></author>
	</entry>
</feed>