Reputation: 3747
Sirs, I have a lot of places in my code where method receives raw user input as string
, then TryParse
s it to actual data type (decimal
, enum
, etc). The object I name by its actual purpose (for example, decimal amount
). But I can't figure what is the best naming convention for raw string
s? rawAmount
? amountString
? amount_raw
? something else? Please let me know what do you think.
Upvotes: 0
Views: 110
Reputation: 9772
I always go:
string amountStr = GetInput();
double amount = double.Parse(amountStr);
Upvotes: 1