- C# 6 and .NET Core 1.0:Modern Cross:Platform Development
- Mark J. Price
- 326字
- 2021-07-09 20:15:45
Practicing and exploring
Test your knowledge and understanding by answering some questions, get some hands-on practice, and explore with deeper research into topics of this chapter.
Exercise 4.1 – test your knowledge
Use the Web to answer the following questions:
- Does every assembly you create have a reference to the
mscorlib.dll
assembly? - What is the maximum number of characters that can be stored in a
string
? - When and why should you use a
SecureString
? - When should you use a
LinkedList
? - When should you use a
SortedDictionary
class rather than aSortedList
class? - Why should you not use the official standard for e-mail addresses to create a regular expression for validating a user's e-mail address?
Exercise 4.2 – practice regular expressions
Create a console application named Ch04_Exercise02 that prompts the user to enter a regular expression, and then prompts the user to enter some input and compare the two for a match until the user presses Esc:
The default regular expression checks for at least one digit. Enter a regular expression (or press ENTER to use the default): ^[a-z]+$ Enter some input: apples apples matches ^[a-z]+$? True Press ESC to end or any key to try again. Enter a regular expression (or press ENTER to use the default): ^[a-z]+$ Enter some input: abc123xyz abc123xyz matches ^[a-z]+$? False Press ESC to end or any key to try again.
Exercise 4.3 – explore topics
Use the following links to read in more detail the topics covered in this chapter:
- .NET Blog: A first hand look from the .NET engineering team: http://blogs.msdn.com/b/dotnet/
- Assemblies and the Global Assembly Cache (C# and Visual Basic): https://msdn.microsoft.com/en-us/library/ms173099.aspx
- String Class: https://msdn.microsoft.com/en-us/library/system.string(v=vs.110).aspx
- StringBuilder Class: https://msdn.microsoft.com/en-us/library/system.text.stringbuilder(v=vs.110).aspx
- Regex Class: https://msdn.microsoft.com/en-us/library/system.text.regularexpressions.regex(v=vs.110).aspx
- How to: Search Strings Using Regular Expressions (C# Programming Guide): https://msdn.microsoft.com/en-us/library/ms228595.aspx
- Regular Expression Language - Quick Reference: https://msdn.microsoft.com/en-us/library/az24scfc(v=vs.110).aspx
- RegExr: Learn, Build, & Test RegExr: http://regexr.com/
- Collections (C# and Visual Basic): https://msdn.microsoft.com/en-us/library/ybcx56wz.aspx
- List<T> Class: https://msdn.microsoft.com/en-us/library/6sh2ey19(v=vs.110).aspx
- Dictionary<TKey, TValue> Class: https://msdn.microsoft.com/en-us/library/xfhwa508(v=vs.110).aspx
- Stack<T> Class: https://msdn.microsoft.com/en-us/library/3278tedw(v=vs.110).aspx
- Queue<T> Class: https://msdn.microsoft.com/en-us/library/7977ey2c(v=vs.110).aspx
- SortedList<TKey, TValue> Class: https://msdn.microsoft.com/en-us/library/ms132319(v=vs.110).aspx
- SortedDictionary<TKey, TValue> Class: https://msdn.microsoft.com/en-us/library/f7fta44c(v=vs.110).aspx
推薦閱讀
- Unreal Engine Physics Essentials
- 數據庫程序員面試筆試真題與解析
- Getting Started with ResearchKit
- Visual Basic程序開發(學習筆記)
- Mastering Ember.js
- Java編程技術與項目實戰(第2版)
- 高級語言程序設計(C語言版):基于計算思維能力培養
- 硅谷Python工程師面試指南:數據結構、算法與系統設計
- Natural Language Processing with Java and LingPipe Cookbook
- Android開發三劍客:UML、模式與測試
- Instant Debian:Build a Web Server
- Scratch·愛編程的藝術家
- Java并發編程:核心方法與框架
- Getting Started with Python
- Android移動應用開發項目教程