Initial commit

This commit is contained in:
Mark J Price 2022-07-08 16:05:38 +01:00
parent 36b9464af2
commit 4a4a0b8e20
4 changed files with 18 additions and 6 deletions

View file

@ -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)

View file

@ -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}");

View file

@ -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)

View file

@ -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}");