Strings (functions): Difference between revisions

From PMDOWiki
Imbion (talk | contribs)
No edit summary
Imbion (talk | contribs)
No edit summary
 
Line 1: Line 1:
{{Hat Note|More functions: [[Script Reference]]''}}
{{Hat Note|More functions: [[Script Reference]]''}}


{{cleanup}}
Functions that relate to the manipulation of strings.


== STRINGS:LocaleCode ==
== LocaleCode ==
Returns the current language setting of the game, represented by a locale code. {{FuncUsage|nmspace=STRINGS|nm=LocaleCode|args=}}


== Format ==


Gets the current language setting of the game.
Formats a string.  Will unescape escaped characters and process grammar tags. Returns the formatted string. {{FuncUsage|nmspace=STRINGS|nm=Format|args=str, args}}
 
 
=== Returns ===
 
The current language, represented by a locale code.
 
== STRINGS:Format(System.String,System.Object[]) ==
 
 
Formats a string.  Will unescape escaped characters and process grammar tags.
 


=== Arguments ===
=== Arguments ===
{| class="wikitable"
{{ArgHeader}}
{{ArgRow
|name=str
|type=String
|techt=System.String
|purp=The string to format.
}}
{{ArgRow
|name=args
|type=Table
|techt=System.Object[]
|purp=Additional arguments to pass into the string being formatted.
}}
|}
== FormatKey ==


* <code>fmt</code>: String to format.
Formats a string given a string key. Will unescape escaped characters. {{FuncUsage|nmspace=STRINGS|nm=FormatKey|args=str, args}}
* <code>para</code>: Arguments
 
=== Returns ===
 
The formatted string.
 
== STRINGS:FormatKey(System.String,System.Object[]) ==
 
 
Formats a string given a string key. Will unescape escaped characters.
 


=== Arguments ===
=== Arguments ===
{| class="wikitable"
{{ArgHeader}}
{{ArgRow
|name=str
|type=String
|techt=System.String
|purp=The string to format.
}}
{{ArgRow
|name=args
|type=Table
|techt=System.Object[]
|purp=Additional arguments to pass into the string being formatted.
}}
|}
== LocalKeyString ==


* <code>fmt</code>: The string key to format
Returns the string representing a button or key. {{FuncUsage|nmspace=STRINGS|nm=LocalKeyString|args=index}}
* <code>para</code>: string arguments
 
== STRINGS:LocalKeyString(System.Int32) ==
 
 
Gets the string representing a button or key.
 


=== Arguments ===
=== Arguments ===
{| class="wikitable"
{{ArgHeader}}
{{ArgRow
|name=inputID
|type=Integer
|techt=System.Int32
|purp=The input type of the input.
}}
|}
== CreateList ==


* <code>index</code>: The input type of the input.
Builds and returns a single string of comma separated elements. {{FuncUsage|nmspace=STRINGS|nm=CreateList|args=}}
 
=== Returns ===
 
The string representing the button o key the input maps to.
 
== STRINGS:CreateList(NLua.LuaTable) ==
 
 
Builds a single string of comma separated elements.
 


=== Arguments ===
=== Arguments ===
 
{| class="wikitable"
* <code>listStrings</code>: LuaTable of strings containing the elements to build the list from.
{{ArgHeader}}
 
{{ArgRow
=== Returns ===
|name=listStrings
 
|type=Table of Strings
The combined string containing all elements.
|techt=NLua.LuaTable
|purp=LuaTable of strings containing the elements to build the list from.
}}
|}

Latest revision as of 03:29, 18 January 2026

More functions: Script Reference

Functions that relate to the manipulation of strings.

LocaleCode

Returns the current language setting of the game, represented by a locale code. Argument order is STRINGS:LocaleCode().

Format

Formats a string. Will unescape escaped characters and process grammar tags. Returns the formatted string. Argument order is STRINGS:Format(str, args).

Arguments

Name Type Technical Type Purpose
str String System.String The string to format.
args Table System.Object[] Additional arguments to pass into the string being formatted.

FormatKey

Formats a string given a string key. Will unescape escaped characters. Argument order is STRINGS:FormatKey(str, args).

Arguments

Name Type Technical Type Purpose
str String System.String The string to format.
args Table System.Object[] Additional arguments to pass into the string being formatted.

LocalKeyString

Returns the string representing a button or key. Argument order is STRINGS:LocalKeyString(index).

Arguments

Name Type Technical Type Purpose
inputID Integer System.Int32 The input type of the input.

CreateList

Builds and returns a single string of comma separated elements. Argument order is STRINGS:CreateList().

Arguments

Name Type Technical Type Purpose
listStrings Table of Strings NLua.LuaTable LuaTable of strings containing the elements to build the list from.