14 Replies
int.TryParse(Console.ReadLine(), out int age)
int.TryParse would return true
if the string is parsable
Otherwise it would return false
And you get the result of the parsed string in the second argumentthank you
:peepoLovee:
ruh roh
it showed this
You have parentheses around the call
oh sh
idk how that got there
is there anyway I can get the code not to display if not a number
Store the return value of TryParse in a bool variable
If it is false the response is not an int
can you show the line of code for that
https://learn.microsoft.com/en-us/dotnet/api/system.int32.tryparse?view=net-8.0
check the first example
i still couldn't figure it out
idk what im doing wrong 😦
btw, you don't need to surround everything with
{ }
okay im used to html and css
probably why
ill come back tmrr