Core Function Reverse

From Sputnik Wiki
(Difference between revisions)
Jump to: navigation, search
(Created page with "<pre> Reverse( <expression> ) </pre> === Description === Reverse all characters in a string. === Parameters === ==== expression ==== The string to use. === Return Value ===...")
 
(Example)
Line 28: Line 28:
 
$str = "The quick brown fox";
 
$str = "The quick brown fox";
 
MsgBox(    Reverse($str)      );
 
MsgBox(    Reverse($str)      );
 +
</syntaxhighlight>
 +
 +
Modify the string in place
 +
<syntaxhighlight lang="sputnik">
 +
$a = "Hello";
 +
say $a; // Hello
 +
$a->Reverse();
 +
say $a; // olleH
 
</syntaxhighlight>
 
</syntaxhighlight>
  
 
[[Category:Core Function]]
 
[[Category:Core Function]]

Revision as of 01:20, 12 September 2013

Reverse( <expression> )

Contents

Description

Reverse all characters in a string.

Parameters

expression

The string to use.

Return Value

Success: Returns new string.

Failure: Returns old string.

Remarks

None.

Example

$str = "The quick brown fox";
MsgBox(     Reverse($str)      );

Modify the string in place

$a = "Hello";
say $a; // Hello
$a->Reverse();
say $a; // olleH
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox