String type
String:
1.Trim ()-The space of the Kinsoku, the space in the middle cannot go.
2.Toupper ()- capitalize all the letters in the string.
3.Tolower ()- turns the letter of the string all lowercase.
4.startswith ("substring");- whether to start with a substring.
5.endswith ("substring");- whether to end with a substring.
6.contains ("substring");- whether the inside contains substrings.
7.substring ( starting position , length ); If the length is omitted, The Intercept ends. Intercepts small substrings from a large string. Position starting from 0
8.indexof ("sub-string"); from the large string, locate the first occurrence of the substring. Returns an integer. Returns -1 if no substring is found in the large string .
9.lasindexof ("sub-string"); from the large string, locate the last occurrence of the substring and return an integer.
10.replacewith ("Original letter", "replacement letter"); Replace the small string specified in the large string with another substring, returning the large string after the substitution.
Date Time Type:
DateTime dt = new DateTime ( year, month, day );
DateTime dt = new DateTime ();
DateTime dt = new DateTime ( year, month, day, time, minute, second );
DateTime dt = DateTime. Now; Get current Time
Console.Write (dt.year); get Current year
Console.Write (Dt.month); Month
Console.Write (Dt.day); Day
Console.Write (Dt.hour); when
Console.Write (Dt.minitue) points ;
Console.Write (Dt.second); seconds
Console.Write (Dt.dayofweek); Day of the week
Console.Write ((int) dt.dayofweek); Number of days of the week.
Console.Write (dt.dayofyear); the day ordinal of a year
Console.Write (dt.addxxx ( digital )); how long after that day if it's negative is how long ago
Console.WriteLine (dt.tostring ("yyyy MM month dd day hh mm points SS seconds "));
For shaping, floating-point types, there is also ToString ("formatted string") only #,0. .
Console.WriteLine (c.tostring ("#,#")); three bit a comma
Console.WriteLine (c.tostring ("#,00")); 0 means no decimals, plus 0 .
Console.WriteLine (math.ceiling (3.14)); the smallest integer greater than the current decimal
Console.WriteLine (Math.floor (3.14)); maximum decimal number less than the current decimal
Console.WriteLine (Math.Round (3.14)); Rounding
Console.WriteLine (math.sqrt ( numeric )); Find square root
String post-add function