<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.multitheftauto.com/wiki/String.startsWith?action=history&amp;feed=atom</id>
	<title>String.startsWith - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.multitheftauto.com/wiki/String.startsWith?action=history&amp;feed=atom"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=String.startsWith&amp;action=history"/>
	<updated>2026-05-08T02:20:24Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=String.startsWith&amp;diff=79425&amp;oldid=prev</id>
		<title>Tracer: Created page with &quot;{{Useful Function}} __NOTOC__ This function checks if a string starts with other string.  ==Syntax== &lt;syntaxhighlight lang=&quot;lua&quot;&gt; bool string.startsWith ( string prefix ) &lt;/syntaxhighlight&gt;  ===Required Arguments=== * '''suffix''': Prefix you want to check your string against  ===Returns=== Returns true if string starts with a prefix, false otherwise.  ==Code== &lt;section name=&quot;Shared script&quot; class=&quot;both&quot; show=&quot;true&quot;&gt; &lt;syntaxhighlight lang=&quot;lua&quot;&gt; function string.startsWith...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=String.startsWith&amp;diff=79425&amp;oldid=prev"/>
		<updated>2024-05-26T11:25:56Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;{{Useful Function}} __NOTOC__ This function checks if a string starts with other string.  ==Syntax== &amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt; bool string.startsWith ( string prefix ) &amp;lt;/syntaxhighlight&amp;gt;  ===Required Arguments=== * &amp;#039;&amp;#039;&amp;#039;suffix&amp;#039;&amp;#039;&amp;#039;: Prefix you want to check your string against  ===Returns=== Returns true if string starts with a prefix, false otherwise.  ==Code== &amp;lt;section name=&amp;quot;Shared script&amp;quot; class=&amp;quot;both&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt; &amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt; function string.startsWith...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Useful Function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function checks if a string starts with other string.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool string.startsWith ( string prefix )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''suffix''': Prefix you want to check your string against&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns true if string starts with a prefix, false otherwise.&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Shared script&amp;quot; class=&amp;quot;both&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function string.startsWith(str, start)&lt;br /&gt;
   return string.sub(str, 1, #start) == start&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Shared script&amp;quot; class=&amp;quot;both&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local str = 'Carl Johnson'&lt;br /&gt;
if str:startsWith('Carl') then&lt;br /&gt;
    iprint('Mr. C. '..str:sub(6))&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Author: Tracer&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>Tracer</name></author>
	</entry>
</feed>