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.

Trim character from string

Help for those learning Tcl or writing their own scripts.
Post Reply
T
Tbb
Voice
Posts: 2
Joined: Wed Dec 17, 2008 3:59 pm

Trim character from string

Post by Tbb »

hi, im new to tcl but i want to trim the next string:

//imagine at with the text "abc|def"

set at "abc|def"
»»»»set at [string trim $at |]««««« this doesnt work!

i want to get only at="abcdef"


how can i trim the "|" character ?
ty

Edit: Changed subject to suite content. (Sir_Fz)
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Code: Select all

set at [string map {| ""} $at]
T
Tbb
Voice
Posts: 2
Joined: Wed Dec 17, 2008 3:59 pm

Post by Tbb »

thank you. it works :)
Post Reply