1. string
Remember that string takes fixing memory until the program ends.
Null and Empty
![](https://pic1.zhimg.com/80/v2-8723cb54f65c8ddbe3b72bcf6117b290_hd.jpg)
In C#, a variable's value is null if it is not set, or if it has been explicitly set to null. A null value typically means the value is not known, or has not yet been set, and is frequently a source of errors in programs, because methods cannot be invoked on null instances of types. An empty string is simply a string with a length of zero. It's a valid instance of a string, but one that currently has no characters in it.
![](https://pic2.zhimg.com/80/v2-4a1f19b4b3bf4d50f8f83600cbdd06da_hd.jpg)
It shows how null can cause an exception. String.IsNullOrEmpty(emptyString) can help.
Some API:
![](https://pic2.zhimg.com/80/v2-f00d2951ceb4db5daad9da206b997206_hd.jpg)
Replacing Parts of Strings
![](https://pic4.zhimg.com/80/v2-a1f2abfa66774e7aa721bfca248d9399_hd.jpg)
The @:
![](https://pic1.zhimg.com/80/v2-1522e2379d111a50583e0cc031549d70_hd.jpg)
Date and Time:
Refer to:Working with Dates and Times
Convert type:
![](https://pic2.zhimg.com/80/v2-962700219c551f0262512b4e6945ed70_hd.jpg)
Logical Expressions:
It is totally same as it is in C++.