| View previous topic :: View next topic |
| Author |
Message |
keeper2 Voice
Joined: 19 Jul 2006 Posts: 12
|
Posted: Fri Jul 21, 2006 9:49 am Post subject: uncomment a * |
|
|
OK I have the following
set oper [lindex [split $arg " "] 6]
if {[string match "*" $oper]} {
...
}
So my problem is now I want to test if the * isin the variable oper, but so it get interpreted as any character. |
|
| Back to top |
|
 |
krimson Halfop

Joined: 19 Apr 2006 Posts: 86
|
Posted: Fri Jul 21, 2006 10:19 am Post subject: |
|
|
so you want to check if '*' is anywhere in your string? or only at the beginning?
| Code: | if {[string first * $oper 0] >0} {
#this will check if there's at least one '*' in $oper
}
|
|
|
| Back to top |
|
 |
keeper2 Voice
Joined: 19 Jul 2006 Posts: 12
|
Posted: Fri Jul 21, 2006 10:35 am Post subject: |
|
|
| krimson wrote: | so you want to check if '*' is anywhere in your string? or only at the beginning?
| Code: | if {[string first * $oper 0] >0} {
#this will check if there's at least one '*' in $oper
}
|
|
seems not to work. I want to test if in the variable $oper is no '*'.
if {![string first * $oper 0] >0} {
#this will check if there's at least no '*' in $oper
}
^^that doesnt't work  |
|
| Back to top |
|
 |
keeper2 Voice
Joined: 19 Jul 2006 Posts: 12
|
Posted: Fri Jul 21, 2006 10:42 am Post subject: |
|
|
if {[string first * $oper 0] < 0} {
#this will check if there's at least no '*' in $oper
}
OK have it
Thanks for help! |
|
| Back to top |
|
 |
krimson Halfop

Joined: 19 Apr 2006 Posts: 86
|
Posted: Fri Jul 21, 2006 11:12 am Post subject: |
|
|
| i misinterpreted your request.. my bad :roll: |
|
| Back to top |
|
 |
|