Question Can you temporarily disable a line of code?

Mentry

New member
Joined
Feb 16, 2023
Messages
2
Programming Experience
Beginner
I'm learning C# in visual studio code and im like taking notes in a c# file and testing what i learn, but is there a way to make it so when i run the file that only specific lines of code get s the input so i could like temporarily disable some lines of code?
 
You could wrap the lines that you don't want to run with:
  • Comments
  • #if-#endif
If it's an entire method that you don't want to be called you can also use Conditional attribute on the method.
 
Back
Top Bottom