<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ur">
	<id>https://ur.wikivahdat.com/w/index.php?action=history&amp;feed=atom&amp;title=%D8%B3%D8%A7%D9%86%DA%86%DB%81%3AString_split%2Fdoc</id>
	<title>سانچہ:String split/doc - تاریخچہ ترمیم</title>
	<link rel="self" type="application/atom+xml" href="https://ur.wikivahdat.com/w/index.php?action=history&amp;feed=atom&amp;title=%D8%B3%D8%A7%D9%86%DA%86%DB%81%3AString_split%2Fdoc"/>
	<link rel="alternate" type="text/html" href="https://ur.wikivahdat.com/w/index.php?title=%D8%B3%D8%A7%D9%86%DA%86%DB%81:String_split/doc&amp;action=history"/>
	<updated>2026-04-19T12:14:00Z</updated>
	<subtitle>ویکی پر اِس صفحہ کا تاریخچۂ نظرثانی</subtitle>
	<generator>MediaWiki 1.43.1</generator>
	<entry>
		<id>https://ur.wikivahdat.com/w/index.php?title=%D8%B3%D8%A7%D9%86%DA%86%DB%81:String_split/doc&amp;diff=1956&amp;oldid=prev</id>
		<title>Wikivahdat: 1 نسخہ درآمد کیا گیا</title>
		<link rel="alternate" type="text/html" href="https://ur.wikivahdat.com/w/index.php?title=%D8%B3%D8%A7%D9%86%DA%86%DB%81:String_split/doc&amp;diff=1956&amp;oldid=prev"/>
		<updated>2022-12-04T05:57:32Z</updated>

		<summary type="html">&lt;p&gt;1 نسخہ درآمد کیا گیا&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;ur&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;→ پرانا نسخہ&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;نسخہ بمطابق 09:27، 4 دسمبر 2022ء&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;ur&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(کوئی فرق نہیں)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Wikivahdat</name></author>
	</entry>
	<entry>
		<id>https://ur.wikivahdat.com/w/index.php?title=%D8%B3%D8%A7%D9%86%DA%86%DB%81:String_split/doc&amp;diff=1955&amp;oldid=prev</id>
		<title>ur&gt;Wikivahdat: /* Template:String_split */ Lua patterns</title>
		<link rel="alternate" type="text/html" href="https://ur.wikivahdat.com/w/index.php?title=%D8%B3%D8%A7%D9%86%DA%86%DB%81:String_split/doc&amp;diff=1955&amp;oldid=prev"/>
		<updated>2022-06-01T03:40:28Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;Template:String_split: &lt;/span&gt; &lt;a href=&quot;https://www.mediawiki.org/wiki/Extension:Scribunto/Lua_reference_manual#Patterns&quot; class=&quot;extiw&quot; title=&quot;mw:Extension:Scribunto/Lua reference manual&quot;&gt;Lua patterns&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;نیا صفحہ&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Documentation subpage}}&lt;br /&gt;
{{Lua|Module:String2}}&lt;br /&gt;
&amp;lt;!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) --&amp;gt;&lt;br /&gt;
[[Template:String split]] is a convenience wrapper for the &amp;lt;code&amp;gt;split&amp;lt;/code&amp;gt; function in [[Module:String2]].&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;split&amp;lt;/code&amp;gt; function splits text at boundaries specified by separator and returns the chunk for the index idx (starting at 1). It can use positional parameters or named parameters (but these should not be mixed):&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{#invoke:String2 |split |text |separator |index |true/false}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{#invoke:String2 |split |txt=text |sep=separator |idx=index |plain=true/false}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
Any double quotes (&amp;quot;) in the separator parameter are stripped out, which allows spaces and wikitext like &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;[&amp;quot;[&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; to be passed. Use &amp;lt;code&amp;gt;{{tl|!}}&amp;lt;/code&amp;gt; for the pipe character &amp;lt;code&amp;gt;|&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If the optional plain parameter is set to &amp;lt;code&amp;gt;false / no / 0&amp;lt;/code&amp;gt; then separator is treated as a [[mw:Extension:Scribunto/Lua reference manual#Patterns|Lua pattern]]. The default is plain=true, i.e. normal text matching.&lt;br /&gt;
&lt;br /&gt;
The index parameter is optional; it defaults to the first chunk of text. A negative parameter value counts chunks backward from the end of the text.&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{String split |This is a piece of text to be split |&amp;quot; &amp;quot;}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; → {{Stringsplit |This is a piece of text to be split |&amp;quot; &amp;quot;}}&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{String split |This is a piece of text to be split |&amp;quot; &amp;quot;| 4}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; → {{Stringsplit |This is a piece of text to be split |&amp;quot; &amp;quot;| 4}}&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{String split |This is a piece of text to be split |x| 2}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; → {{Stringsplit |This is a piece of text to be split |x| 2}}&lt;br /&gt;
Modules may return strings with | as separators like this: &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{#invoke:carousel | main | name = WPDogs | switchsecs = 5 }}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; → {{#invoke:carousel | main | name = WPDogs | switchsecs = 5 }}&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{String split |{{#invoke:carousel | main | name = WPDogs | switchsecs = 5 }}|{{!}}| 2}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; → {{Stringsplit |{{#invoke:carousel | main | name = WPDogs | switchsecs = 5 }}|{{!}}| 2}}&lt;br /&gt;
[[mw:Extension:Scribunto/Lua reference manual#Patterns|Lua patterns]] can allow splitting at classes of characters such as punctuation:&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{String split |Apples, pears, oranges; Cats, dogs|&amp;quot;%p&amp;quot;| 2 |false}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; → {{Stringsplit |Apples, pears, oranges; Cats, dogs|&amp;quot;%p&amp;quot;| 2 |false}}&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{String split |Apples, pears, oranges; Cats, dogs|&amp;quot;%p&amp;quot;| 4 |false}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; → {{Stringsplit |Apples, pears, oranges; Cats, dogs|&amp;quot;%p&amp;quot;| 4 |false}}&lt;br /&gt;
Or split on anything that isn&amp;#039;t a letter (no is treated as false):&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{String split |Apples pears oranges;  Cats  dogs|&amp;quot;%A+&amp;quot;| 4 |no}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; → {{Stringsplit |Apples pears oranges;  Cats  dogs|&amp;quot;%A+&amp;quot;| 4 |no}}&lt;br /&gt;
Named parameters force the trimming of leading and trailing spaces in the parameters and are generally clearer when used:&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{String split | txt=Apples pears oranges;  Cats  dogs | sep=&amp;quot;%A+&amp;quot; | idx=3 | plain=false }}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; → {{Stringsplit | txt=Apples pears oranges;  Cats  dogs | sep=&amp;quot;%A+&amp;quot; | idx=3 | plain=false }}&lt;br /&gt;
A negative index will count back from the end of the text:&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{String split |txt=This is a piece of text to be split |sep=&amp;quot; &amp;quot; |idx=-1}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; → {{Stringsplit |txt=This is a piece of text to be split |sep=&amp;quot; &amp;quot; |idx=-1}}&lt;br /&gt;
An easy mistake to make when using negative parameters is to forget that a trailing space in the text when passed as an unnamed parameter will induce an empty last chunk:&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{String split |This is a piece of text to be split |&amp;quot; &amp;quot;|-1}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; → {{Stringsplit |This is a piece of text to be split |&amp;quot; &amp;quot;|-1}}&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{String split |This is a piece of text to be split|&amp;quot; &amp;quot;|-1}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; → {{Stringsplit |This is a piece of text to be split|&amp;quot; &amp;quot;|-1}}&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
{{String-handling templates}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;includeonly&amp;gt;{{sandbox other||&lt;br /&gt;
&amp;lt;!-- Categories below this line, please; interwikis at Wikidata --&amp;gt;&lt;br /&gt;
[[Category:String manipulation templates]]&lt;br /&gt;
}}&amp;lt;/includeonly&amp;gt;&lt;/div&gt;</summary>
		<author><name>ur&gt;Wikivahdat</name></author>
	</entry>
</feed>