This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

How to remove certain characters in a string

Old posts that have not been replied to for several years.
Locked
g
gerkes

How to remove certain characters in a string

Post by gerkes »

Let's say i have this string(1word) (~xxmcx@egghelp.org)



How would I go about removing the ( & ) & @, then putting the ident and hostmask into 2 different variables?

:-?
User avatar
Xpert
Halfop
Posts: 88
Joined: Mon Mar 08, 2004 7:03 am

Post by Xpert »

You can use 'split':

Code: Select all

set host "[split ~xxmcx@egghelp.org @]"
set userident "[lindex $host 0]"
set userhost "[lindex $host 1]"
:P
Xpert.
g
gerkes

Post by gerkes »

THANK YOU! i was searching the forums and was progressing, your lines seems a lot simpler and more efficient than what i have in hand right now. thanks once again :D
User avatar
Xpert
Halfop
Posts: 88
Joined: Mon Mar 08, 2004 7:03 am

Post by Xpert »

Your welcome :P
Xpert.
User avatar
caesar
Mint Rubber
Posts: 3776
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Use "trim" if you want to get rid of the ~ thing :)
Once the game is over, the king and the pawn go back in the same box.
Locked