| View previous topic :: View next topic |
| Author |
Message |
NewzNZ Halfop

Joined: 05 Mar 2009 Posts: 60
|
Posted: Mon Sep 23, 2019 6:43 pm Post subject: question marks in strings |
|
|
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 |
|
 |
willyw Revered One
Joined: 15 Jan 2009 Posts: 1175
|
Posted: Mon Sep 23, 2019 7:16 pm Post subject: Re: question marks in strings |
|
|
| 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 |
|
 |
NewzNZ Halfop

Joined: 05 Mar 2009 Posts: 60
|
Posted: Mon Sep 23, 2019 7:48 pm Post subject: |
|
|
| Great will give that a try...thanks for the reply! |
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Tue Sep 24, 2019 1:03 am Post subject: |
|
|
What about string first ? $string? _________________ Once the game is over, the king and the pawn go back in the same box. |
|
| Back to top |
|
 |
NewzNZ Halfop

Joined: 05 Mar 2009 Posts: 60
|
Posted: Tue Sep 24, 2019 5:00 am Post subject: |
|
|
| Thanks will try also! =) |
|
| Back to top |
|
 |
|