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.
Help for those learning Tcl or writing their own scripts.
soulfly
Voice
Posts: 2 Joined: Tue Apr 25, 2006 11:53 pm
Post
by soulfly » Tue Apr 25, 2006 11:59 pm
Hey guy's. I was searching here for the replacement function.
But I found nothing, or I was too stupid to mange the Search :X
My problem is very simple, I think.
I want to replace * with % in $value
I tried regsub -all but it didn't worked.
Thanky you for any help.
greetz soulfly
DragnLord
Owner
Posts: 711 Joined: Sat Jan 24, 2004 4:58 pm
Location: C'ville, Virginia, USA
Post
by DragnLord » Wed Apr 26, 2006 1:48 am
soulfly
Voice
Posts: 2 Joined: Tue Apr 25, 2006 11:53 pm
Post
by soulfly » Wed Apr 26, 2006 3:31 am
Oh thx, I already solved by problem.
I used string map
But can u tell me wich is faster?
I have several options.
Once it should replace * and ' ' (space) by a % (for the sql query)
And other time it sould
searchfor '(', ')', '-', '.', '_'
replacew '', '', ' ', ' ', ' '
They are sorted as above + below.
Thx in future for any help
De Kus
Revered One
Posts: 1361 Joined: Sun Dec 15, 2002 11:41 am
Location: Germany
Post
by De Kus » Wed Apr 26, 2006 4:43 am
depends on length of string and cacheablitlity of the whole script. I'd say string map is about twice as fast. As longer the string and as more seldom it gets called cached (precompiled) as bigger will be the difference.
De Kus
StarZ|De_Kus, De_Kus or DeKus on IRC
Copyright © 2005-2009 by De Kus - published under
The MIT License
Love hurts, love strengthens...