egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

strip chars

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
whittinghamj
Op


Joined: 21 May 2006
Posts: 103

PostPosted: Fri Sep 21, 2007 6:22 pm    Post subject: strip chars Reply with quote

I have an output of

Code:

123/4567.89


I am trying to strip out (delete) everything before the " / " AND get rid of the " / " as well. Any ideas please? the part of 123 will change from between 4 and 8 letters so cannot do a static removal - need to search for " / " and del everything < it if that makes sence

Thanks in advance
Back to top
View user's profile Send private message
rosc2112
Revered One


Joined: 19 Feb 2006
Posts: 1454
Location: Northeast Pennsylvania

PostPosted: Fri Sep 21, 2007 6:43 pm    Post subject: Reply with quote

Code:
regsub {(.*?)/(.*?)} $inputvar {\2} outputvar

Check the tcl regsub manpage for details about subSpec and such.
Back to top
View user's profile Send private message
TCL_no_TK
Owner


Joined: 25 Aug 2006
Posts: 509
Location: England, Yorkshire

PostPosted: Fri Sep 21, 2007 6:44 pm    Post subject: Re: strip chars Reply with quote

Try using split
Quote:
[lindex [split "123/4567.89" /] 1]
would return 4567.89 Smile
_________________
TCL the misunderstood
Back to top
View user's profile Send private message Send e-mail
whittinghamj
Op


Joined: 21 May 2006
Posts: 103

PostPosted: Fri Sep 21, 2007 7:14 pm    Post subject: [ SOLVED} strip chars Reply with quote

ty very much
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
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


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber