When reading from a ASCII file, I have following code:

val fr = (new File(name)).openRead();
val li = fr.lines();
while (li.hasNext()) {
    val line = li.next();
    // process line here...
}

The surprise I have is that each 'line' contains a '\n' character at the 
end.  There are 2 points here:
     1. Maybe we want to treat only '\n' as end-of-line.  If this is the 
assumption, users may don't want to see it in the resulted string.
     2. Maybe we need to consider other possibilities as well, e.g. '\r' 
only on Mac, '\r\n' on Windows, if we don't want to hard code the '\n' in 
the source.

Regards,
   - Qiming 

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
X10-users mailing list
X10-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/x10-users

Reply via email to