From WikiChip
Difference between revisions of "mirc/identifiers/$left"
m (Put back the identifier list.) |
|||
(2 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | {{mirc title|$left Identifier}} | + | {{mirc title|$left Identifier}}'''$left''' is a {{mIRC|string manipulation}} identifier used to return characters from the left side of a string. |
− | '''$left''' is a {{mIRC|string manipulation}} identifier used to return characters from the left side of a string. | ||
== Synopsis == | == Synopsis == | ||
Line 8: | Line 7: | ||
<span style="display: inline-block; width: 105px;">'''<string>'''</span>The string to manipulate | <span style="display: inline-block; width: 105px;">'''<string>'''</span>The string to manipulate | ||
− | <span style="display: inline-block; width: 105px;">'''<length>'''</span>The length or number of characters to remove from the original string. <length> can be a positive or negative. | + | <span style="display: inline-block; width: 105px;">'''<length>'''</span>The length or number of characters to remove from the original string. <length> can be a positive or negative. Using 0 returns $null (0 characters). |
− | |||
If the length provided is positive, $left will return the <length> characters from the left of the string. | If the length provided is positive, $left will return the <length> characters from the left of the string. | ||
Line 15: | Line 13: | ||
; abcd</syntaxhighlight> | ; abcd</syntaxhighlight> | ||
− | If the length provided is negative, $left will return the | + | If the length provided is negative, $left will return the string except the rightmost <length> characters. |
− | <syntaxhighlight lang="mirc">$left(abcdefg, - | + | <syntaxhighlight lang="mirc">$left(abcdefg, -2) |
; abcde</syntaxhighlight> | ; abcde</syntaxhighlight> | ||
Line 27: | Line 25: | ||
; [AB]</syntaxhighlight> | ; [AB]</syntaxhighlight> | ||
− | + | == See also == | |
− | == See | ||
* {{mIRC|string manipulation}} | * {{mIRC|string manipulation}} | ||
* {{mIRC|$right}} | * {{mIRC|$right}} | ||
* {{mIRC|$mid}} | * {{mIRC|$mid}} | ||
+ | * {{mIRC|$pos}} | ||
+ | {{mIRC identifier list}} | ||
− | + | [[Category:mIRC identifiers|left]] | |
− | [[Category: |
Latest revision as of 14:09, 22 September 2022
Commands & Identifiers
Basics
Events
Matching Tools
Data Storage
Control Structures
GUI Scripting
Sockets
Advanced Scripting
Additional Resources
Security
Other
$left is a string manipulation identifier used to return characters from the left side of a string.
Contents
Synopsis[edit]
$left(<string>, <length>)
Parameters[edit]
<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. Using 0 returns $null (0 characters).
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 string except the rightmost <length> characters.
$left(abcdefg, -2) ; abcde
More Examples[edit]
$left(appleseed, -4) ; apple
$left([AB]BotName, 4) ; [AB]
See also[edit]
mIRC identifier list