mIRC Home    About    Download    Register    News    Help

Print Thread
remove the last character of a string #113574 06/03/05 12:12 PM
Joined: Mar 2005
Posts: 1
P
puns Offline OP
Mostly harmless
OP Offline
Mostly harmless
P
Joined: Mar 2005
Posts: 1
hi
say %hello is the string 'hello!', i want to remove the last character i.e. the ! how would i go about doing this.

thanks in advance
puns

Re: remove the last character of a string #113575 06/03/05 12:38 PM
Joined: Feb 2004
Posts: 2,019
FiberOPtics Offline
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
//echo -a $left(hello!,-1)


Gone.
Re: remove the last character of a string #113576 06/03/05 12:39 PM
Joined: Dec 2002
Posts: 145
G
gemeau50 Offline
Vogon poet
Offline
Vogon poet
G
Joined: Dec 2002
Posts: 145
$left(%hello,-1)

Re: remove the last character of a string #113577 06/03/05 02:47 PM
Joined: Aug 2004
Posts: 237
L
LethPhaos Offline
Fjord artisan
Offline
Fjord artisan
L
Joined: Aug 2004
Posts: 237
is there a better way to script $right($1-,$calc($len($1-) - 3)) ?

Re: remove the last character of a string #113578 06/03/05 03:00 PM
Joined: Feb 2004
Posts: 2,019
FiberOPtics Offline
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
U mean $mid($1-,4) ?


Gone.
Re: remove the last character of a string #113579 06/03/05 03:30 PM
Joined: Dec 2002
Posts: 1,321
H
Hammer Offline
Hoopy frood
Offline
Hoopy frood
H
Joined: Dec 2002
Posts: 1,321
$right($1-, -3)


DALnet: #HelpDesk and #m[color:#FF0000]IR[color:#EEEE00]C
Re: remove the last character of a string #113580 06/03/05 03:43 PM
Joined: Aug 2004
Posts: 237
L
LethPhaos Offline
Fjord artisan
Offline
Fjord artisan
L
Joined: Aug 2004
Posts: 237
indeed $rigth($1-,-3)
I think I get the negative values thing now. Thanks!

Re: remove the last character of a string #113581 07/03/05 03:53 AM
Joined: Feb 2004
Posts: 2,019
FiberOPtics Offline
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
Umm $right($1-,-3) is the same as $mid($1-,4) heh, just a tad shorter grin


Gone.