Thread overview
[Issue 8880] New: Feature Request into both std.ascii std.uni isNewline
Oct 23, 2012
bioinfornatics
Oct 23, 2012
bioinfornatics
Mar 29, 2013
Nick Sabalausky
October 23, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=8880

           Summary: Feature Request into both std.ascii std.uni isNewline
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody@puremagic.com
        ReportedBy: bioinfornatics@gmail.com


--- Comment #0 from bioinfornatics <bioinfornatics@gmail.com> 2012-10-23 15:47:13 PDT ---
both std.ascii std.uni provides isWhite but any provides isNewline maybe something like


bool isNewline(dchar c) @safe pure nothrow
{
    return ( c == 0x0A || c == 0x0D )? isWhite( c ) : false;
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
October 23, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=8880



--- Comment #1 from bioinfornatics <bioinfornatics@gmail.com> 2012-10-23 15:57:46 PDT ---
unittest

import std.stdio;
import std.ascii;

bool isNewline(dchar c) @safe pure nothrow {
    return ( c == 0x0A || c == 0x0D )? isWhite( c ) : false;
}

void main(){
    string test1 = "test\n";
    string test2 = "test\r\n";
    string test3 = "test\r";
    foreach( letter; test1 ) writeln( letter, isNewline( letter ) );
    foreach( letter; test2 ) writeln( letter, isNewline( letter ) );
    foreach( letter; test3 ) writeln( letter, isNewline( letter ) );
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
October 27, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=8880


hsteoh@quickfur.ath.cx changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hsteoh@quickfur.ath.cx
           Severity|normal                      |enhancement


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
March 29, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=8880


Nick Sabalausky <cbkbbejeap@mailinator.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |cbkbbejeap@mailinator.com
         Resolution|                            |DUPLICATE


--- Comment #2 from Nick Sabalausky <cbkbbejeap@mailinator.com> 2013-03-28 17:35:23 PDT ---
Duplicate of #9045. Closing this one because #9045 has more discussion.

*** This issue has been marked as a duplicate of issue 9045 ***

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