Practicing and exploring
Test your knowledge and understanding by answering some questions, getting some hands-on practice, and exploring with deeper research into the topics in this chapter.
Exercise 8.1 – Test your knowledge
Use the web to answer the following questions:
- What is the maximum number of characters that can be stored in a
string
variable? - When and why should you use a
SecureString
type? - When is it appropriate to use a
StringBuilder
class? - When should you use a
LinkedList<T>
class? - When should you use a
SortedDictionary<T>
class rather than aSortedList<T>
class? - In a regular expression, what does
$
mean? - In a regular expression, how can you represent digits?
- Why should you not use the official standard for email addresses to create a regular expression to validate a user's email address?
- What characters are output when the following code runs?
string city = "Aberdeen";
ReadOnlySpan<char> citySpan = city.AsSpan()[^5..^0]...