User:DonQuich: Difference between revisions

From Civilization Modding Wiki
Jump to navigationJump to search
m (testing my bot)
m (testing my bot)
Line 16: Line 16:
print(test); -- prints true</pre>
print(test); -- prints true</pre>


[[Category:Civ5LuaLocale|StartsWith]]
[[Category:Civ5Lua/Locale|StartsWith]]

Revision as of 13:59, 9 August 2012

This page is a part of the Lua and UI Reference.


Syntax

bool Locale.StartsWith(string base_string, string prefix) Return Value

Returns true if base_string starts with prefix, false otherwise.

Parameters

base_string
The string to test against.
prefix
The prefix to test with.

Examples

local test = Locale.StartsWith("Civilization", "Civ");
print(test); -- prints true