Thư viện tri thức trực tuyến
Kho tài liệu với 50,000+ tài liệu học thuật
© 2023 Siêu thị PDF - Kho tài liệu học thuật hàng đầu Việt Nam

Chapter12 - Working with String potx
Nội dung xem thử
Mô tả chi tiết
Chapter 12. Working With String
Hoang Anh Viet
VietHA@it-hut.edu.vn
HaNoi University of Technology
1
Microsoft
Objectives
2
“Describes how strings are a first-class type in the CLR and
how to use them effectively in C#. A large portion of the chapter
covers the string-formatting capabilities of various types in
the .NET Framework and how to make your defined types
behave similarly by implementing IFormattable. Additionally, I
introduce you to the globalization capabilities of the framework
and how to create custom CultureInfo for cultures and regions
that the .NET Framework doesn’t already know about.”
Microsoft
Roadmap
12 .1 String Overview
12.2 String Literals
12.3 Format Specifiers and Globalization
12.4 Working String from Outsite Sources
12 5 StringBuilder
12.6 Searching Strings with Regular Expression.
.
3
Microsoft
12.1 String Overview
In C#, String is a built-in type.
In the built-in type collection , String is a reference type and but
most of the built-in types are value types.
4
Microsoft
String Basics
A string is an object of type String whose value is text.
The text is stored as a readonly collection of Char objects.
Each of which represents one Unicode character encoded in UTF16.
There is no null-terminating character at the end of a C# string
(unlike C and C++). therefore a C# string can contain any number
of embedded null characters ('\0').
The length of a string represents the number of characters
regardless of whether the characters are formed from Unicode
surrogate pairs or not.
5