User:DonQuich: Difference between revisions

From Civilization Modding Wiki
Jump to navigationJump to search
m (testing my bot)
m (testing my bot)
Line 1: Line 1:
''This page is a part of the [[Lua and UI Reference]].''
''This page is a part of the [[Lua and UI Reference]].''


 
Test if a string starts with a specified prefix (UTF-8 friendly)
==Syntax==
==Syntax==
<code>'''bool''' Locale.StartsWith('''string''' base_string, '''string''' prefix)</code>
<code>'''bool''' Locale.StartsWith('''string''' base_string, '''string''' prefix)</code>
'''Return Value'''
'''Return Value'''
:Returns true if base_string starts with prefix, false otherwise.
:Returns true if base_string starts with prefix, false otherwise.

Revision as of 14:02, 9 August 2012

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

Test if a string starts with a specified prefix (UTF-8 friendly)

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