Class 5.7

Source: Internet
Author: User
Tags root math square root email account

stringclass. The length of a length character. TrimStart Remove the space at the beginning of the string. TrimEND () Removes the space following the string. ToUpper () all uppercase. Tolower () All lowercase substring (start position, intercept length) substring (starting position) Indextof ("string") returns the index of the first occurrence of this string startswith ("string") Whether to start with this string, or to return True or Falseendswith ("string") Whether to end with this string Contins ("string") contains this string, replace ("Old word","new Word"replace the old word with the new Word math class ceiling () Take the line floor () to remove the thread Math.PI Pi math.sqrt () square root math.round () rounding (odd remove limit, even take line) DateTime class note in the use Before you initialize the datetime=Newdatetime () can not be initialized if getting the current time: DateTime=datetime.now//system time, run-time querygets the year dt.year gets the month dt. Month gets the day dt. Day gets the hour Dt.hour gets the sub dt. Minute gets the second dt. Second gets the day of the week DayOfWeek D=dt. DAYOFWeek; obtained is English in Chinese needs ToString conversion yyyy mm month DD Day hh lowercase delegate 12 o'clock uppercase represents 24 o'clock mm min ss seconds above is on behalf of the character. You can take the empty space in the string first. stringS=dt. Tosting ("yyyy mm month dd Day hh mm min ss sec";D atetime can increase or subtract the corresponding time add () increases or subtracts a certain interval addyears () increases or subtracts the year addmonth () increases or subtracts the month adddays () increases or subtracts the number of days plus or minus days, and the number of hours is the use of the Do The uble type. Others are int type exercises: Determine if the mailbox format is correct//1. Have and can only have one @//2. Cannot start with @//there is at least one after [email protected].//[email protected] and. Can't stay together.//5. Cannot end with.//Console.Write ("Please enter your email account:"); //string mail = Console.ReadLine (); //if (mail. Contains ("@"))//{            //int Aa=mail.            IndexOf ("@"); //int BB =mail.            LastIndexOf ("@"); //if (aa== bb)//    {            //bool a = mail.            StartsWith ("@"); //if (!a)//        {            //string ss = Mail.            Substring (AA); //if (ss.            Contains (".")) //            {            //int dian = ss.            IndexOf ("."); //if (dian! = 1)//                {            //int hou = ss.            LastIndexOf ("."); //if (hou! = ss. LENGTH-1)//                    {            //Console.WriteLine ("Enter the correct format for the mailbox!")            "); //                    }            //Else//                    {            //Console.WriteLine ("Wrong input!            "); //                    }            //                }            //Else//                {            //Console.WriteLine ("Wrong input!            "); //                }            //            }            //Else//            {            //Console.WriteLine ("Wrong input!            "); //            }            //        }            //Else//        {            //Console.WriteLine ("Wrong input!            "); //        }            //    }            //Else//    {            //Console.WriteLine ("Wrong input!            "); //    }            //}            //Else//{            //Console.WriteLine ("Wrong input!            "); //}

Class 5.7

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.