Fixing std.string

Ezneh petitv.isat at gmail.com
Fri Aug 20 13:33:22 PDT 2010


Andrei Alexandrescu Wrote:

 
> I guess
> 
>    return collectException(to!real(input)) is null;
> 
> should be a fine replacement for isNumeric.
> 
> 
> Andrei


I found another way to improve the isNumeric function.

I'm doing it  with a (ugly) regular expression but it works very well but maybe we could (should !) improve it a bit more.


See in the attach file how I did it.
There are some asserts and "old tests". I probably forget something but this can be a new base for the isNumeric function.


Give me any feed back and telle me wath you think about it.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: newIsNumeric.d
Type: application/octet-stream
Size: 3343 bytes
Desc: not available
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20100820/68b0d2b5/attachment.obj>


More information about the Digitalmars-d mailing list