This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Remove character

Help for those learning Tcl or writing their own scripts.
Post Reply
F
Failed
Voice
Posts: 1
Joined: Mon Aug 17, 2009 9:04 am

Remove character

Post by Failed »

Hi, everyone!

how can i remove the first character of a word?

Cya
User avatar
tomekk
Master
Posts: 255
Joined: Fri Nov 28, 2008 11:35 am
Location: Oswiecim / Poland
Contact:

Post by tomekk »

Code: Select all

set a "word"

puts [string range $a 1 end]

Code: Select all

set a "word"

regsub {[^.]} $a "" a

puts $a

Code: Select all

set a "word"

set a [join [lrange [split $a {}] 1 end] ""]

puts $a
[tomekk@zonk]:~# ./zonk.tcl
ord
ord
ord
Post Reply