I've got this variable named "ref":
802.11ac(auto),802.11n+a
Then I have this value, named "val":
802.11ac(auto)
so I want to check if $val is inside $ref
This is what I do:
set elements [split $ref ","]
if {([llength $elements] > 1) && ($val != "")} {
so it does B because I've checked and "[lsearch $elements $val]" is -1
However "puts [lindex $elements 0]" is 802.11ac(auto)
Anyone could tell me what I'm missing, please? Thanks a lot!
802.11ac(auto),802.11n+a
Then I have this value, named "val":
802.11ac(auto)
so I want to check if $val is inside $ref
This is what I do:
set elements [split $ref ","]
if {([llength $elements] > 1) && ($val != "")} {
if {[lsearch $elements $val] != -1} {
do A
}
else{
do B
}
}so it does B because I've checked and "[lsearch $elements $val]" is -1
However "puts [lindex $elements 0]" is 802.11ac(auto)
Anyone could tell me what I'm missing, please? Thanks a lot!