[Issue 9045] Feature request for std.asscii => function isNewline

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Nov 18 17:08:09 PST 2012


http://d.puremagic.com/issues/show_bug.cgi?id=9045



--- Comment #2 from bioinfornatics <bioinfornatics at gmail.com> 2012-11-18 17:08:08 PST ---
(In reply to comment #1)
> See representation on various systems:
> 
> http://en.wikipedia.org/wiki/Newline
> 
> In particular:
> On Unix, and Mac OS X: LF (1 char)
> On Windows: CR+LF (2 chars)

yes not easy or into string

bool isNewline(in dchar[] c) @safe pure nothrow {
    bool result = false;
    if( c[0] == 0x0A)
        result = true;
    else if( c.length >= 2 && c[0] == 0x0D && c[1] == 0x0A)
        result = true;
    ...
    ...
    return result;
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list