Skip to main content
2 of 5
added 40 characters in body
Doc Brown
  • 220.3k
  • 35
  • 410
  • 623

What does it mean by "set" in programming languages like c#?

I've been reeding a book which was about C# programming language and faced the term set, So now my question is what the word 'set' came in the following means?

Pattern matching with the switch statement: Like the if statement, the switch statement > supports pattern matching in C# 7.0 and later. The case values no longer need to be literal values; they can be patterns. Let's see an example of pattern matching with the switch statement using a folder path. If you are using macOS, then swap the commented statement that sets the path variable and replace my username with your user folder name:

  1. Add the following statement to the top of the file to import types for working with input/output: using System.IO;
  2. Add statements to the end of the Main method to declare a string path to a file, open it as either a readonly or writeable stream, and then show a message based on what type and capabilities the stream has, as shown in the following code:
  // string path ="/Users/markjprice/Code/Chapter03"; 
  string path => @"C:\Code\Chapter03"; 
  Write("Press R for readonly or W for write: ");
  ConsoleKeyInfo key = ReadKey(); 
  WriteLine(); ...

actually my question is about the following part:

If you are using macOS, then swap the commented statement that sets the path variable and replace my username with your user folder name

Would anybody exactly explain it to me?

Hossein
  • 75
  • 1
  • 4