Core Function isVarString
From Sputnik Wiki
(Difference between revisions)
(Created page with "<pre> isVarString( $variable ) </pre> === Description === Checks if a variable is a string type. === Parameters === ==== variable ==== The variable to check. === Return Val...") |
|||
| Line 15: | Line 15: | ||
=== Return Value === | === Return Value === | ||
| − | Success: Returns | + | Success: Returns true. |
| − | Failure: Returns | + | Failure: Returns false. |
=== Remarks === | === Remarks === | ||
| Line 26: | Line 26: | ||
<syntaxhighlight lang="sputnik"> | <syntaxhighlight lang="sputnik"> | ||
| − | $var1 = " | + | $var1 = "Hello World"; |
println( "Is it?: " . isVarString($var1) ); | println( "Is it?: " . isVarString($var1) ); | ||
| + | // Alternative | ||
| + | println( $var1 is string ); | ||
| + | // Alternative | ||
| + | println( $var1 ~~ string ); | ||
</syntaxhighlight> | </syntaxhighlight> | ||
[[Category:Core Function]] | [[Category:Core Function]] | ||
Latest revision as of 10:35, 29 August 2013
isVarString( $variable )
Contents |
Description
Checks if a variable is a string type.
Parameters
variable
The variable to check.
Return Value
Success: Returns true.
Failure: Returns false.
Remarks
None.
Example
$var1 = "Hello World"; println( "Is it?: " . isVarString($var1) ); // Alternative println( $var1 is string ); // Alternative println( $var1 ~~ string );