From WikiChip
Difference between revisions of "mirc/identifiers/$right"
< mirc‎ | identifiers

(create page for $right identifier)
 
(Typo: on->from)
Line 11: Line 11:
  
  
If the length provided is positive, $right will return the <length> characters on the right of the string.
+
If the length provided is positive, $right will return the <length> characters from the right of the string.
 
<syntaxhighlight lang="mirc">$right(abcdefg, 4)
 
<syntaxhighlight lang="mirc">$right(abcdefg, 4)
 
; defg</syntaxhighlight>
 
; defg</syntaxhighlight>
Line 19: Line 19:
 
<syntaxhighlight lang="mirc">$right(abcdefg, -2)
 
<syntaxhighlight lang="mirc">$right(abcdefg, -2)
 
; cdefg</syntaxhighlight>
 
; cdefg</syntaxhighlight>
 
  
 
== More Examples ==
 
== More Examples ==

Revision as of 15:25, 29 July 2014

Template:mIRC Guide $right is a string manipulation identifier used to return characters from the right side of a string.

Synopsis

$right(<string>, <length>)

Parameters

<string>The string to manipulate

<length>The length or number of characters to remove from the original string. <length> can be a positive or negative. It cannot be 0.


If the length provided is positive, $right will return the <length> characters from the right of the string.

$right(abcdefg, 4)
; defg

If the length provided is negative, $right will return the characters in the string minus <length> on the left.

$right(abcdefg, -2)
; cdefg

More Examples

$right(appleseed, -4)
; eseed
$right([AB]BotName, 4)
; Name


See Also