egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

question marks in strings

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
NewzNZ
Halfop


Joined: 05 Mar 2009
Posts: 60

PostPosted: Mon Sep 23, 2019 6:43 pm    Post subject: question marks in strings Reply with quote

Hi there

Am trying to single out question marks (?) in some of my strings...

Have tried:

if {[string match "*\?*" $string]} {

..but no luck...
Any ideas would be appreciated...cheers.


Last edited by NewzNZ on Tue Sep 24, 2019 4:26 am; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website
willyw
Revered One


Joined: 15 Jan 2009
Posts: 1175

PostPosted: Mon Sep 23, 2019 7:16 pm    Post subject: Re: question marks in strings Reply with quote

NewzNZ wrote:
Hi there
...
Have tried:

if {[string match "*\?*" $string]} {

..but no luck...
Any ideas would be appreciated...cheers.


Code:

[string match {*\?*} $string]


or

Code:

[string match "*\\?*" $string]


I'm sorry, I can't remember where I got that from, so I can't provide you with a reference.
_________________
For a fun (and popular) Trivia game, visit us at: irc.librairc.net #science-fiction . Over 300K Q & A to play in BogusTrivia !
Back to top
View user's profile Send private message
NewzNZ
Halfop


Joined: 05 Mar 2009
Posts: 60

PostPosted: Mon Sep 23, 2019 7:48 pm    Post subject: Reply with quote

Great will give that a try...thanks for the reply!
Back to top
View user's profile Send private message Visit poster's website
caesar
Mint Rubber


Joined: 14 Oct 2001
Posts: 3741
Location: Mint Factory

PostPosted: Tue Sep 24, 2019 1:03 am    Post subject: Reply with quote

What about string first ? $string?
_________________
Once the game is over, the king and the pawn go back in the same box.
Back to top
View user's profile Send private message
NewzNZ
Halfop


Joined: 05 Mar 2009
Posts: 60

PostPosted: Tue Sep 24, 2019 5:00 am    Post subject: Reply with quote

Thanks will try also! =)
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber