mIRC Home    About    Download    Register    News    Help

Print Thread
#192821 11/01/08 12:07 PM
Joined: Jan 2008
Posts: 1
A
acc15 Offline OP
Mostly harmless
OP Offline
Mostly harmless
A
Joined: Jan 2008
Posts: 1
What method should I use to remove leading and trailing whitespaces from a string?

acc15 #192832 11/01/08 03:22 PM
Joined: Jul 2006
Posts: 4,145
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,145
$regsubex with a very nice pattern smile

Edit : i think i misunderstood what you mean.

Last edited by Wims; 11/01/08 03:35 PM.

#mircscripting @ irc.swiftirc.net == the best mIRC help channel
acc15 #192835 11/01/08 03:30 PM
Joined: Feb 2006
Posts: 546
J
Fjord artisan
Offline
Fjord artisan
J
Joined: Feb 2006
Posts: 546
you could use $gettok(string,1-,32) which also replaces multiple consecutive spaces with a single one

eg. $gettok(_a__b_____c__,1-,$asc(_)) = a_b_c


"The only excuse for making a useless script is that one admires it intensely" - Oscar Wilde

Link Copied to Clipboard