asp.net string to heavy __.net

Source: Internet
Author: User
String strplanreceiver = String.
            Empty; String strplanreceiverole = String.
            Empty;
            Taskmodel model = new Taskmodel ();
            Systemmanager Syman = new Systemmanager ();  Model = Syman.gettaskreceiverinfobyid (TaskID);
                According to TaskID get the task recipient configuration information if (model!= null) {#region construct the receiver, receiver role string, and go to heavy Constructs the receiver, recipient role string, which is used to send messages strplanreceiver + = model.
                Planreceiver + ","; Strplanreceiver + = model.
                PlanReceiver0 + ","; Strplanreceiver + = model.
                PlanReceiver1 + ","; Strplanreceiver + = model.
                PlanReceiver2 + ","; Strplanreceiver + = model.
                PlanReceiver3 + ",";

                Strplanreceiver = Strplanreceiver.trim (', '); Strplanreceiverole + = model.
                Planreceiverole + ","; Strplanreceiverole + = model.
                PlanReceiveRole0 + ","; Strplanreceiverole + = model.
                PlanReceiveRole1 + ","; StrpLanreceiverole + = model.
                PlanReceiveRole2 + ","; Strplanreceiverole + = model.
                PlanReceiveRole3 + ",";

                Strplanreceiverole = Strplanreceiverole.trim (', ');    The string goes heavy Strplanreceiver = Stringunique (strplanreceiver);    Receiver string to go heavy Strplanreceiverole = Stringunique (strplanreceiverole); Receive role string to #endregion}


#region string to///<summary>///string///</summary>///<param name= "Strli
        St "></param>///<returns></returns> private String Stringunique (String strlist) {//1. Converts strings to array string result = String.
            Empty;

            string[] Str_num = Strlist.split (', ');
            2. Define ArrayList to determine that the repeating field in the array is not added to the ArrayList object ArrayList al = new ArrayList (); for (int i = 0; i < Str_num. Length; i++) {//To determine whether an if (AL) already exists. Contains (str_num[i]) = = False) {al.
                ADD (Str_num[i]); }//3. Converts ArrayList to an array of str_num = new String[al.
            Count]; Str_num = (string[]) al.

            ToArray (typeof (String)); 3. Array to string, and a comma interval result = string.

            Join (",", str_num);
        return result;; } #endregion


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.