C # required actions on string

Source: Internet
Author: User

    1. Letter to uppercase: variable name.  ToUpper (); or string. ToUpper (variable name);

    2. The letter goes lowercase: variable name.  ToLower (); or string. ToLower (variable name);

    3. Comparison of characters: ①:string. Equals (variable name, variable name); Returns a Boolean value

      ②:string.compare (variable name, variable name, variable name, variable name .......). );

      ③: The simplest and most used: variable name = = variable name or variable name! = Variable Name

    4. A string that is formatted. Format (the variable to be converted 1, the variable to be converted 2); 650) this.width=650; "Src=" http://s5.51cto.com/wyfs02/M00/85/23/ Wkiom1ea1-vy9ae1aabllac6mhe974.png-wh_500x0-wm_3-wmp_4-s_174865166.png "title=" QQ20160729121303.png "alt=" Wkiom1ea1-vy9ae1aabllac6mhe974.png-wh_50 "/>
    5. Intercept of string: variable name. sbustring (from the beginning of the first few); returns a new string; starting from 0
    6. The split variable name of the string. Split (character/character array) "delimiter"

Gca

String s=abcdeabcdeabcde;string[] Sarray=s.split (' C '); foreach (string I in Sarray) Console.WriteLine (i.ToString ()); Output the following result: Abdeabdeabde

7. Merging of strings:

String 1+ String 2

This article is from the "Frank" blog, so be sure to keep this source http://cyg2001.blog.51cto.com/11309618/1831656

C # required actions on string

Related Article

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.