❔ help with code

what is the problem in this code?
11 Replies
phaseshift
phaseshift2y ago
Don't know, what is the problem?
SmolLime117
SmolLime1172y ago
i dont understand why it is highlighting Console.ReadLine(); yellow
Thinker
Thinker2y ago
the only thing there is a warning it's not an error
phaseshift
phaseshift2y ago
It tells you when you mouse over it
SmolLime117
SmolLime1172y ago
yeah but even when there is nothing there is says there is a problem
Thinker
Thinker2y ago
that's just vscode being vscode restart vsc and it'll probably be fixed
SmolLime117
SmolLime1172y ago
oh
Thinker
Thinker2y ago
but anyway, the warning itself says that the result of Console.ReadLine() may be null You can solve this either by doing Console.ReadLine() ?? "" or doing Console.ReadLine()! The first of which is kinda the most preferable
SmolLime117
SmolLime1172y ago
oh ok that makes sense thanks
Thinker
Thinker2y ago
a ?? b essentially means "if a is not null then return a from the expression, otherwise return b"
Accord
Accord2y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server
More Posts
❔ What is the difference between these two pieces of code?```cs static PlayerHandler HPlayer => Program.HPlayer; ``` ```cs static PlayerHandler HPlayer = Prog❔ Questions about popupsI'm newer to the UI via xaml + c# space, so I have a question about creation like shown here in the ❔ Microservice: User information being split up in IdentityProvider and ServiceProviderMicroservice: User information being split up in IdentityProvider and ServiceProvider This will req❔ Optimization thoughts on a loop.Looking for potential ways to speed up this operation. Any thoughts? The entries of each HashSet wil❔ How to shorten switch statement```cs public void SwitchAvailability(string koalaName) { switch(koalaNam❔ BinaryFormatter does not serialize/deserialize the Tags of listview itemsso i have a listview that i want to serialize and then desirialize. I store some values in the tags ❔ ✅ Using generics that implement IEqualityOperators results in ambiguous call to the == operatorIf I have some `T: IEqualityOperators<T, T, bool>` and use a LINQ query such as `myTs.FirstOrDefault✅ Simple questionI have a code which ```cs if ("any" is "item1" or "item2" or "any") { Console.WriteLine("okay");Hi im not sure that my code is working as it should(class in c sharp)providing code here👇(When i add +1 or +10 to the GetX or GetY isn't it supossed to change?)❔ VISUAL STUDIO C# DATABASE AND LISTBOXI am currently working on my assignment and am stuck on this issue Where I have a Database to fetch