digitalmars.D.learn - std.string.atoi should throw exception
- Dawid =?UTF-8?B?Q2nEmcW8YXJraWV3aWN6?= (4/4) Nov 29 2005 I can't find isInt(char[] s) or something like atoi throwing exception
- Don Clugston (6/11) Nov 29 2005 Look in std.conv. You'll find:
- Dawid =?UTF-8?B?Q2nEmcW8YXJraWV3aWN6?= (3/6) Nov 29 2005 Thanks. BTW. Maybe merging std.string and std.conf would be good idea. E...
I can't find isInt(char[] s) or something like atoi throwing exception (name: toInt(char[] s) would be good IMO). Have I overlooked such function and if not - do you think it should be added to phobos?
Nov 29 2005
Dawid Ciężarkiewicz wrote:I can't find isInt(char[] s) or something like atoi throwing exception (name: toInt(char[] s) would be good IMO). Have I overlooked such function and if not - do you think it should be added to phobos?Look in std.conv. You'll find: int toInt(char[] s) ... Any deviation from that grammar causes a ConvError exception to be thrown. Any overflows cause a ConvOverflowError to be thrown.
Nov 29 2005
Don Clugston wrote:Look in std.conv. You'll find: int toInt(char[] s)Thanks. BTW. Maybe merging std.string and std.conf would be good idea. Every std.conv function works on string.
Nov 29 2005