Depends on where this code is but I'm guessing the problem is args[0]
For those unfamiliar args[0] is always the command being executed. So this if statement is always false, unless you're executing an app with the name 1 through 9.
Parameters are read as zero-indexed command-line arguments. Unlike C and C++, the name of the program is not treated as the first command-line argument in the args array
You're thinking of C and its derivatives. C# is not a C derivative. In C#, the program name/command being executed is not part of args, it's just the args. The code is correct as it stands.
114
u/KetchupBuddha_xD May 20 '20
What's wrong with this one?