Replies: 3 comments 2 replies
-
For Java, it requires the int result;
if (!result.TryParse("42"))
Console.WriteLine("Cannot parse");
Console.WriteLine(result);
I'll add this.
The reason is that file I/O is different in a browser and on Android than on desktop OSes. I couldn't design a consistent API. |
Beta Was this translation helpful? Give feedback.
-
Also with enums, would it be possible to use an enum inside of an interpolated string? Otherwise converting the enum to int then using the int in the interpolated string would work. |
Beta Was this translation helpful? Give feedback.
-
I see that C# will give the integer value of an enum if you use a :D format. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
How can we convert a string to a number? I see tryparse is not supported in java.
Also is there a way to convert an enum to an integer? Having to write switches does not scale well for larger enums.
Otherwise I've tried using an abstract class for the user of the library to provide the functionality. I've also done that for File IO. But I can see File IO as out of scope.
Beta Was this translation helpful? Give feedback.
All reactions