![]() |
Available news archives:
comp.lang.tcl
-
comp.lang.python
-
comp.security.firewalls
-
sci.crypt -
comp.lang.php -
comp.lang.javascript
|
|
comp.lang.tcl archiveRe: Bests way to handle lines in files with only a return character?
From: Donal K. Fellows <donal.k.fellows@manchester.ac.uk>
Date: Sat Dec 31 2005 - 00:01:14 CET
slebetman@yahoo.com wrote:
Hmm, as someone who likes REs I'd be tempted to replace those lines
set line [string trim [regsub {//.*} $line {}]]
But then there's the whole issue of quoting (what if you want to retain
set line [regsub {^//.*} [string trim $line] {}]
Though if you're processing lines in a loop, it's actually more common
foreach line $theData {
There are probably as many variations on this as there are Tclers. :-)
Donal.
|