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.
Old posts that have not been replied to for several years.
sirkrunch
Voice
Posts: 19 Joined: Wed Oct 09, 2002 2:36 am
Post
by sirkrunch » Sun Sep 28, 2003 5:22 pm
how do i go about stripping text
like i have a tcl that when some1 triggers it returns a result (ofcouse)
but Iwant to take out some of it
eg
<user>!search website
<bot>
http://www.website.com
I would like it to be
<bot>
www.website.com
removing eveything b4 the 2nd slash
and how do u use string length?
set x [string length[$text]
if ($x => 3) {
?? im new to tcl and not sure how the cmds are setout cheers
w
w0t
Post
by w0t » Sun Sep 28, 2003 7:06 pm
Code: Select all
set lnk "http://www.website.com"
regexp {//(.*)} $lnk g link
sirkrunch
Voice
Posts: 19 Joined: Wed Oct 09, 2002 2:36 am
Post
by sirkrunch » Sun Sep 28, 2003 9:10 pm
cheers
so this would work?
Code: Select all
set line "[gets $openf]"
regexp {/(.*)} $line g link
that will read off the openfile and have it like
/
www.blah
??
and
Code: Select all
set x [string length[$text]
if ($x => 3) {
is that correct??[/code]
Papillon
Owner
Posts: 724 Joined: Fri Feb 15, 2002 8:00 pm
Location: *.no
Post
by Papillon » Mon Sep 29, 2003 1:41 am
Code: Select all
set url [string range $text 6 end]
if it's always in the "
http://www ..... format
Elen sila lúmenn' omentielvo
strikelight
Owner
Posts: 708 Joined: Mon Oct 07, 2002 10:39 am
Contact:
Post
by strikelight » Mon Sep 29, 2003 7:09 pm
Papillon wrote: Code: Select all
set url [string range $text 6 end]
if it's always in the "
http://www ..... format
Papillon!!!!!
Thought you were going away for a year?? =p