Core Function ResolveStr
From Sputnik Wiki
(Difference between revisions)
Line 19: | Line 19: | ||
False to disallow parsing of escapes. | False to disallow parsing of escapes. | ||
− | Default: | + | Default: false |
==== allowVariables ==== | ==== allowVariables ==== | ||
Line 27: | Line 27: | ||
False to disallow parsing of variables. | False to disallow parsing of variables. | ||
− | Default: | + | Default: false |
==== allowCode ==== | ==== allowCode ==== | ||
Line 35: | Line 35: | ||
False to disallow parsing of variables. | False to disallow parsing of variables. | ||
− | Default: | + | Default: false |
=== Return Value === | === Return Value === | ||
Line 51: | Line 51: | ||
<syntaxhighlight lang="sputnik"> | <syntaxhighlight lang="sputnik"> | ||
println("Without Resolve: " . 'The value is $lol' ); | println("Without Resolve: " . 'The value is $lol' ); | ||
− | println("With Resolve: " . ResolveStr('The value is $lol') ); | + | println("With Resolve: " . ResolveStr('The value is $lol', true, true, true) ); |
</syntaxhighlight> | </syntaxhighlight> | ||
[[Category:Core Function]] | [[Category:Core Function]] |
Revision as of 18:26, 13 October 2013
ResolveStr( <expression>, <allowEscapes>, <allowVariables>, <allowCode> )
Contents |
Description
Treat a given string as if it was a Sputnik "string" and parse all stuff inside it such as $variables etc.
Parameters
expression
The string to use.
allowEscapes
True to allow parsing of escapes such as \n etc.
False to disallow parsing of escapes.
Default: false
allowVariables
True to allow parsing of variables such as $cat @cow etc.
False to disallow parsing of variables.
Default: false
allowCode
True to allow parsing of stuff inside { } and/or \C \c as physical Sputnik code.
False to disallow parsing of variables.
Default: false
Return Value
Success: Returns new string.
Failure: Returns empty string.
Remarks
None.
Example
println("Without Resolve: " . 'The value is $lol' ); println("With Resolve: " . ResolveStr('The value is $lol', true, true, true) );