Click here to Skip to main content
15,887,881 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to tryParse a variable and return the value without storing it.



C#
memory = memory - Double.Parse(display.Text);


Here in the above code the display.Text value is directly parsed without being stored

Is there any way to TryParse the above code without using any variable
Posted

 
Share this answer
 
No, there's no way to avoid the out modified variable of a TryParse() method.

Why are you concerned about it?
If it's many such conversions one after another, you can re-use the same double variable.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900