<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.multitheftauto.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Nextz</id>
	<title>Multi Theft Auto: Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.multitheftauto.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Nextz"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/wiki/Special:Contributions/Nextz"/>
	<updated>2026-05-07T07:25:32Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=String.count&amp;diff=46775</id>
		<title>String.count</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=String.count&amp;diff=46775"/>
		<updated>2016-03-05T02:17:58Z</updated>

		<summary type="html">&lt;p&gt;Nextz: Simplify the function&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}}&lt;br /&gt;
&amp;lt;lowercasetitle&amp;gt;&amp;lt;/lowercasetitle&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function counts how many times a string is found from within another string.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;int string.count(string text, string search)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''text:''' A string to find the text from&lt;br /&gt;
*'''search:''' A string defining what to find&lt;br /&gt;
&lt;br /&gt;
== Code ==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function string.count (text, search)&lt;br /&gt;
	if ( not text or not search ) then return false end&lt;br /&gt;
	&lt;br /&gt;
	return select ( 2, text:gsub ( search, &amp;quot;&amp;quot; ) );&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
outputChatBox( string.count( &amp;quot;Just a test string&amp;quot;, &amp;quot;t&amp;quot; ) ) -- and the result is 4!&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Created by Krischkros, Edited by nextz.&lt;/div&gt;</summary>
		<author><name>Nextz</name></author>
	</entry>
</feed>