mirror of
https://github.com/markjprice/cs11dotnet7.git
synced 2026-01-04 15:19:57 +01:00
Initial commit
This commit is contained in:
parent
36b9464af2
commit
4a4a0b8e20
|
|
@ -65,7 +65,7 @@ foreach (KeyValuePair<string, string> item in keywords)
|
|||
WriteLine($" {item.Key}: {item.Value}");
|
||||
}
|
||||
|
||||
// lookup a value using a key
|
||||
// look up a value using a key
|
||||
string key = "long";
|
||||
WriteLine($"The definition of {key} is {keywords[key]}");
|
||||
|
||||
|
|
@ -99,7 +99,7 @@ PriorityQueue<string, int> vaccine = new();
|
|||
|
||||
// add some people
|
||||
// 1 = high priority people in their 70s or poor health
|
||||
// 2 = medium priority e.g. middle aged
|
||||
// 2 = medium priority e.g. middle-aged
|
||||
// 3 = low priority e.g. teens and twenties
|
||||
|
||||
vaccine.Enqueue("Pamela", 1); // my mum (70s)
|
||||
|
|
|
|||
|
|
@ -14,7 +14,13 @@ else
|
|||
WriteLine($"This is not a valid age: {input}");
|
||||
}
|
||||
|
||||
string films = "\"Monsters, Inc.\",\"I, Tonya\",\"Lock, Stock and Two Smoking Barrels\"";
|
||||
// C# 1 to 10: Use escaped double-quote characters \"
|
||||
// string films = "\"Monsters, Inc.\",\"I, Tonya\",\"Lock, Stock and Two Smoking Barrels\"";
|
||||
|
||||
// C# 11 or later: Use """ to start and end a raw string literal
|
||||
string films = """
|
||||
"Monsters, Inc.","I, Tonya","Lock, Stock and Two Smoking Barrels"
|
||||
""";
|
||||
|
||||
WriteLine($"Films to split: {films}");
|
||||
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ foreach (KeyValuePair<string, string> item in keywords)
|
|||
WriteLine($" {item.Key}: {item.Value}");
|
||||
}
|
||||
|
||||
// lookup a value using a key
|
||||
// look up a value using a key
|
||||
string key = "long";
|
||||
WriteLine($"The definition of {key} is {keywords[key]}");
|
||||
|
||||
|
|
@ -99,7 +99,7 @@ PriorityQueue<string, int> vaccine = new();
|
|||
|
||||
// add some people
|
||||
// 1 = high priority people in their 70s or poor health
|
||||
// 2 = medium priority e.g. middle aged
|
||||
// 2 = medium priority e.g. middle-aged
|
||||
// 3 = low priority e.g. teens and twenties
|
||||
|
||||
vaccine.Enqueue("Pamela", 1); // my mum (70s)
|
||||
|
|
|
|||
|
|
@ -14,7 +14,13 @@ else
|
|||
WriteLine($"This is not a valid age: {input}");
|
||||
}
|
||||
|
||||
string films = "\"Monsters, Inc.\",\"I, Tonya\",\"Lock, Stock and Two Smoking Barrels\"";
|
||||
// C# 1 to 10: Use escaped double-quote characters \"
|
||||
// string films = "\"Monsters, Inc.\",\"I, Tonya\",\"Lock, Stock and Two Smoking Barrels\"";
|
||||
|
||||
// C# 11 or later: Use """ to start and end a raw string literal
|
||||
string films = """
|
||||
"Monsters, Inc.","I, Tonya","Lock, Stock and Two Smoking Barrels"
|
||||
""";
|
||||
|
||||
WriteLine($"Films to split: {films}");
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue