Application of the class

Source: Internet
Author: User
Tags add time root math

Try (catch error) {Code to execute} catch (Exception) {error (Exception) handling code} finally {final code to execute}

String class

String str = "ASD";

Str. Length: String * * * * * * * str[index number]

Str. Trim (): Remove the left and right sides of the space * * * str. TrimStart (): Remove the left space str. TrimEnd (): Remove the space on the right

Str. ToLower (): Uppercase to lowercase str. ToUpper (): Lowercase to uppercase

Str. StartsWith (): Matches the beginning of Str. EndsWith (): Matches the end of Str. Contains (): matches the entire string ******

Str. IndexOf (): Where a string appears in Str (where it first appears) Str. LastIndexOf (): The last occurrence of a string in str

Str. Substring (): Intercept string ******

Str. Replace (replaces the string inside the parentheses)

Math class:

Math.Round (n,0); Rounding (fractional with fractional reservation) math.ceiling (n), taking the smallest integer greater than the decimal Math.floor (n), taking the maximum integer smaller than the decimal math.sqrt (a), opening the square, square root math.pow (2,4); 2 of the 4-time Square

DateTime class

int a = d.year; year int b = d.month; month int c = d.day; Day int e = d.hour; hour int f = d.minute; minutes int g = d.second; seconds int h = D.mill Isecond; int k = d.dayofyear; the first day of this year

DayOfWeek L = d.dayofweek; week

System.TimeSpan da = new TimeSpan (1,0,0,0); D = D.add (DA); plus a day.

AddYears ()-----addseconds (); Add time

ToString ("yyyy mm month DD day hh" mm min ss sec ")

Application of the class

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.