Skip to content

PKLOC.substituteVariables

kerrishotts edited this page Nov 12, 2012 · 1 revision

(part of PKLOC)

Return Type: string

Parameters: theString ( string ), theParms ( array )

Although useable by your code, it is mainly intended to be used by the localization functions. It is used to replace substitution variables such as %1 with the associated value from theParms.

For example:

var x = PKLOC.substituteVariables ( "The %1 is %2", ["sky","blue"] );

Notes

  • Substitution variables are one-based and correspond to their zero-based counterparts in the array. That means %1 = theParms[0].

Version

0.1 Introduced

0.2 Docs Valid

Clone this wiki locally