Core Function UC

From Sputnik Wiki
(Difference between revisions)
Jump to: navigation, search
(Created page with "<pre> UC( <expression> ) </pre> === Description === Returns string in all Upper Case. === Parameters === ==== expression ==== The string to evaluate. === Return Value === ...")
 
(Example)
 
(7 intermediate revisions by one user not shown)
Line 5: Line 5:
 
=== Description ===
 
=== Description ===
  
Returns string in all Upper Case.
+
The string to use.
  
 
=== Parameters ===
 
=== Parameters ===
Line 22: Line 22:
 
$result = UC("testing");
 
$result = UC("testing");
 
Println("Result:" , $result); // Prints TESTING
 
Println("Result:" , $result); // Prints TESTING
 +
</syntaxhighlight>
 +
 +
Modify the string in place
 +
 +
<syntaxhighlight lang="sputnik">
 +
$value = "testing";
 +
Println($value); // Prints testing
 +
// Modify the string in place
 +
my $n = StrLen($value);
 +
my $i = 0;
 +
while ($n-- > 0)
 +
{
 +
$value[$i] = UC($value[$i]);
 +
$i++;
 +
}
 +
// All done
 +
Println($value); // Prints TESTING
 
</syntaxhighlight>
 
</syntaxhighlight>
  
 
[[Category:Core Function]]
 
[[Category:Core Function]]

Latest revision as of 09:57, 19 September 2015

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
my $n = StrLen($value);
my $i = 0;
while ($n-- > 0)
{
	$value[$i] = UC($value[$i]);
	$i++;
}
// All done
Println($value); // Prints TESTING
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox