title: How can I cut the substring from a string in tcl
body: <p>I have string like <code>NYMEX UTBPI</code>. Here I want to fetch the index of white space in middle of NYMEX and UTBPI and then from that index to last index I want to cut the substring. In this case my substring will be <code>UTBPI</code>
  I'm using below</p>
  
  <pre><code>set part1 [substr $line [string index  $line " "] [string index  $line end-1]]
  </code></pre>
  
  <p>I'm getting below error.</p>
  
  <pre><code>wrong # args: should be "string index string charIndex"
      while executing
  "string index  $line  "
      ("foreach" body line 2)
      invoked from within
  "foreach line $pollerName {
  set part1 [substr $line [string index  $line  ] [string index  $line end-1]]
  puts $part1
  puts $line
  }"
      (file "Config.tcl" line 9)</code></pre>
  
  <p>Can you give me the idea on how can I do some other string manupulation as well. Any good link for this.</p>