I've string like this a sample one what I need is parse through the string and get the value of a parameter for example value of -type is Eth, so just the string next to the string I give.
card-1-3-1 3 -Number 2 -type Eth -config Yes -GEPorts 3
set s {card-1-3-1 3 -Number 2 -type Eth -config Yes -GEPorts 3}
dict get $s -type
# -> Eth
By default, card-1-3-1 becomes a key in the "eyes" of the dict command, but as long as that isn't a problem you don't need anything more complex than this. All the keys must have following values (i.e. the string must be a proper, even-sized list where the items are in key-value order).
dict command was added in Tcl 8.5, back in 2007. If you are using an older version, please upgrade: Tcl 8.4 and older are no longer supported for either security or bugs. If you can't upgrade, there is a pure-Tcl replacement for dict that can be used in Tcl 8.4.dict doesn't have quite all the good properties of the 8.5 one, but it might be good enough. Though upgrade is the official message.