Strings
43 scripting commands. Also as Markdown for agents.
- +Add two Numbers, concatenate two Arrays or two Strings, or create a copy of an Array or HashMap.
- commentDefines a comment. See SQF Syntax#Comments to learn more about comments.
- compileCompiles String expression into Code.
- compileFinalCompiles an expression / takes an existing HashMap and makes it final, preventing it from being modified or overwritten (by = assignation,…
- composeTextCreates a Structured Text by joining the given structured or plain text arguments.
- copyFromClipboardReturn ANSI content of the (text) clipboard. If Unicode support is desired, see forceUnicode.
- copyToClipboardCopies ANSI text string to the clipboard. If Unicode support is desired, see forceUnicode.
- countCan be used to count: - The number of elements in an array (returns the already internally known array size) - The number of elements in an array…
- diag_localizedReturns array with all localized keys from the given stringtable or the array of all stringtables names if empty string `""` is given. Common…
- endlCreates a string containing a line break, similar to lineBreak for text. The name is inspired by c++ std::endl (end line). The command returns…
- findSearches for an array element within an array or an ANSI string within an ANSI string.
- forceUnicodeList of the commands that work with forceUnicode - copyFromClipboard - copyToClipboard - count - find - in - insert - reverse - select - splitString…
- formatComposes a string containing other variables or other variable types. Converts any variable type to a string.
- formatTextCreates a Structured Text similar to format command.
- fromJSONObtain the game value from the provided JSON-formatted string.
- getTextWidthReturns estimated width of the text based on font type and size. Similar to ctrlTextWidth but does not require a control and can be used to estimate…
- hintOutputs a hint message to the right of the screen (left of the screen in Operation Flashpoint) with a sound (except in Armed Assault).
- hintCDisplays a very basic message dialog in the center of the screen. Player control is taken away until "Continue" is pressed. The message dialog can be…
- hintSilentSame as hint, but without a sound.
- imageCreates a structured text containing the given image. Use setAttributes to set additional attributes on the image.
- inChecks whether value is in array, unit is in vehicle, position is inside location or ANSI string is part of other ANSI string. If Unicode support is…
- insertInserts multiple values into Array/String/HashMap.
- isLocalizedChecks whether given *stringName* is localized.
- joinStringJoins *array* into String with provided *separator*. Array can be of mixed types, all elements will be converted to String prior to joining, but the…
- lineBreakCreates a structured text containing a line break.
- localizeUsed to internationalise text messages. The provided translation key is looked up in Stringtable.xml (or Stringtable.csv).
- parseNumberParses the string, interpreting its content as a floating point number.
- parseSimpleArrayConverts given, formatted as simple array, String into a valid Array. Simple array is array consisting of Numbers, Strings, Booleans and Arrays of…
- parseTextCreates a structured text by parsing the given XML description. Do not use parseText when displaying a localized text from Stringtable.xml.
- selectSelects an element from an array, config entry from Config or substring from a string or a range from an array.
- setAttributesReturns a Structured Text created from the given structured text and sets attributes to the given values.
- splitStringSplits the provided ANSI string into an array of tokens according to given delimiters.
- strConverts any value into a string, depending on its type. If an Object has a vehicleVarName, it is returned (see #Example 4).
- textCreates a structured text containing the given plain text if argument is String. Use setAttributes to set additional attributes on the text. If the…
- toArrayConverts the supplied String into an Array of Numbers. The numbers in the created array are the decimal Unicode representations of characters.
- toFixedConverts a number into a string, keeping the specified number of decimals. If the desired number of decimals is higher than the actual number, nulls…
- toJSONConverts data to JSON.
- toLowerConverts the supplied Unicode string to all lowercase characters. If the string doesn't have characters with codes > 255, use toLowerANSI.
- toLowerANSIConverts the supplied string to all lower case characters fast (could be 3× faster than toLower). ANSI in this case refers to ISO-8859-1 code page.
- toStringConverts the supplied Array of Numbers into a String through <https://en.wikipedia.org/wiki/Unicode> characters representation conversion, or…
- toUpperConverts the supplied Unicode string to all uppercase characters. If the string doesn't have characters with codes > 255, use toUpperANSI.
- toUpperANSIConverts the supplied string to all upper case characters fast (could be 3x faster than toUpper). ANSI in this case refers to ISO-8859-1 code page.
- trimTrims a string.