13th Day
2016-04-21
I. String type
String
Trim ()-The space of the Kinsoku, the space in the middle cannot go.
ToUpper ()-Turns the letter of the string into uppercase.
ToLower ()-Turns the letter of the string all lowercase.
StartsWith ("substring")-whether to start with "substring", is-true
EndsWith ("substring")-whether to end with "substring", is-true
Contains ("substring")-whether it contains "substrings", is-true
Substring (start position, length)-from the large string, intercept the small substring out.
IndexOf ("substring")-from the large string, locate the first occurrence of the substring. Returns an integer. If a string is not found in the large string, return-1
LastIndexOf ("substring")-from the large string, locate the last occurrence of the substring. Returns an integer. If a string is not found in the large string, return-1
ReplaceWith ("Substituted substring", "New substring"): Converts the string specified in a large string into another small string, returning the large string after the substitution.
Two. Date and Time type:
DateTime dt = new DateTime ();
DateTime dt = new DateTime (1999,2,12);
DateTime dt = new DateTime (1999,2,12,13,45,56);
DateTime dt = DateTime.Now; Get current time
Dt. Year,dt. Month,dt. Day,dt. Hour,dt. Minitue,dt. Second
Dt. DayOfWeek, dt. DayOfYear
Dt. Addxxxx ();
Dt. ToString ("formatted string")
Yyyy,yy-year mm,m-month dd,d-day hh,h mm,m minutes ss,s seconds
Expand:
For integral type, floating point type, there is also ToString ("formatted string") #,0.
Three. Mathematical operations
Math
Math.ceiling (decimal) returns the smallest integer greater than the current decimal number
Math.floor (decimal) returns the largest integer less than the current decimal number
Math.Round (decimal) rounding
Math.sqrt (value) to find square root
20160421 string type; Date Time type mathematical type