|
remove the last character of a string
#113574
06/03/05 12:12 PM
|
Joined: Mar 2005
Posts: 1
puns
OP
Mostly harmless
|
OP
Mostly harmless
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
Hoopy frood
|
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
gemeau50
Vogon poet
|
Vogon poet
Joined: Dec 2002
Posts: 145 |
|
|
|
Re: remove the last character of a string
#113577
06/03/05 02:47 PM
|
Joined: Aug 2004
Posts: 237
LethPhaos
Fjord artisan
|
Fjord artisan
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
Hoopy frood
|
Hoopy frood
Joined: Feb 2004
Posts: 2,019 |
Gone.
|
|
|
Re: remove the last character of a string
#113579
06/03/05 03:30 PM
|
Joined: Dec 2002
Posts: 1,321
Hammer
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 1,321 |
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
LethPhaos
Fjord artisan
|
Fjord artisan
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
Hoopy frood
|
Hoopy frood
Joined: Feb 2004
Posts: 2,019 |
Umm $right($1-,-3) is the same as $mid($1-,4) heh, just a tad shorter 
Gone.
|
|
|
|
|
|