Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Using tcl string trim command..

3 views
Skip to first unread message

Enrico

unread,
Jul 13, 2002, 4:55:19 AM7/13/02
to
I need to know how remove the } or { chars from a string using the string
strim command.
thanks


Hans Herrmann

unread,
Jul 13, 2002, 6:24:40 AM7/13/02
to

"Enrico" <enri...@inwind.it> schrieb im Newsbeitrag
news:XVRX8.30937$K_4.7...@twister1.libero.it...

> I need to know how remove the } or { chars from a string using the string
> strim command.
> thanks
>
Use this method:
############
% set x dk\{
dk{
% set n [string trimright $x \{]
dk
############
Hans


Bryan Oakley

unread,
Jul 13, 2002, 9:42:38 AM7/13/02
to

Is that *really* the problem, or is the problem that you are printing
out something that shouldn't have {}'s in it, but they somehow are
magically appearing?

Just curious -- many people have this problem when first starting out
with Tcl. If this is the case, you are likely trying to treat a list as
a string. Instead of removing the curly braces from the string
representation of the list, it is generally better to convert the list
or list element to a bona fide string.

ulis

unread,
Jul 13, 2002, 11:20:53 AM7/13/02
to
"Enrico" <enri...@inwind.it> wrote in message news:<XVRX8.30937$K_4.7...@twister1.libero.it>...

> I need to know how remove the } or { chars from a string using the string
> strim command.
> thanks

For a discussion about list stripping: http://mini.net/tcl/3400

ulis

0 new messages