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

(changed {{mIRC guide}} to {{mIRC Guide}} and changed synopsis to fit preceding standard)
(Typo: on->from)
Line 11: Line 11:
  
  
If the length provided is positive, $left will return the <length> characters on the left of the string.
+
If the length provided is positive, $left will return the <length> characters from the left of the string.
 
<syntaxhighlight lang="mirc">$left(abcdefg, 4)
 
<syntaxhighlight lang="mirc">$left(abcdefg, 4)
 
; abcd</syntaxhighlight>
 
; abcd</syntaxhighlight>
Line 19: Line 19:
 
<syntaxhighlight lang="mirc">$left(abcdefg, -3)
 
<syntaxhighlight lang="mirc">$left(abcdefg, -3)
 
; abcde</syntaxhighlight>
 
; abcde</syntaxhighlight>
 
  
 
== More Examples ==
 
== More Examples ==

Revision as of 15:25, 29 July 2014

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

Synopsis

$left(<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, $left will return the <length> characters from the left of the string.

$left(abcdefg, 4)
; abcd

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

$left(abcdefg, -3)
; abcde

More Examples

$left(appleseed, -4)
; apple
$left([AB]BotName, 4)
; [AB]


See Also