Core Function UC
From Sputnik Wiki
(Difference between revisions)
(→Example) |
(→Example) |
||
Line 29: | Line 29: | ||
$value = "testing"; | $value = "testing"; | ||
Println($value); // Prints testing | Println($value); // Prints testing | ||
− | $value-> | + | // Modify the string in place |
+ | fixed ($p = $value) | ||
+ | { | ||
+ | my $n = StrLen($value); | ||
+ | my $i = 0; | ||
+ | while ($n-- > 0) | ||
+ | { | ||
+ | $p[$i] = UC($p[$i]); | ||
+ | $i++; | ||
+ | } | ||
+ | } | ||
+ | // All done | ||
Println($value); // Prints TESTING | Println($value); // Prints TESTING | ||
− | |||
</syntaxhighlight> | </syntaxhighlight> | ||
[[Category:Core Function]] | [[Category:Core Function]] |
Revision as of 17:46, 10 August 2014
UC( <expression> )
Contents |
Description
The string to use.
Parameters
expression
The string to evaluate.
Return Value
Uppercase string.
Example
$result = UC("testing"); Println("Result:" , $result); // Prints TESTING
Modify the string in place
$value = "testing"; Println($value); // Prints testing // Modify the string in place fixed ($p = $value) { my $n = StrLen($value); my $i = 0; while ($n-- > 0) { $p[$i] = UC($p[$i]); $i++; } } // All done Println($value); // Prints TESTING