|
mrtpyo Newbie
Joined: 14 Dec 2005 Posts: 2
|
Posted: Sat Dec 17, 2005 8:20 am
Newbie Variable Question |
Greetings,
Let @name1 variable be a string or word like "large dog."
Is there a way to tell ZMud to only return X number of characters of the variable?
For example, instead of kill @name1 returning "kill 'large dog'", I want it to return "kill 'larg'" (first 4 characters) of the variable.
Thanks |
|
|
|
darkspot Apprentice
Joined: 29 Jul 2002 Posts: 105
|
Posted: Sat Dec 17, 2005 11:02 am |
From the help file
left
Syntax: %left(s,n)
return the leftmost n characters of the string s
Examples:
#SHOW %left(0815,2)
displays: 08
#SHOW %left("abc~~def",4)
displays
abc~
memory aid:
%left(anystring,@anynumber) plus %right(anystring,@anynumber) is 'anystring'
----------------------------
Therefore
kill %left(@name1, 4)
would be what you want |
|
|
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|