On Wednesday, 10 June 2015 at 17:19:30 UTC, Binarydepth wrote:
Hi, If it is not much trouble, care to explain how ?

If it is user input, take it in the format they send it. Like:

string typed_data;

if(isNumeric(typed_data)) {
   auto number = to!int(typed_data);
   // do stuff with humber
} else {
   // treat it as a string still
}


This tends to be the way I'd do it in python or ruby too.

Reply via email to