Multiple phone numbers separated by commas

Source: Internet
Author: User

     #regionThat tests the array type.string[] mobiles =New string[] {"18975887650","18775887650","18977487650","18975887512" }; /// <summary>      ///loop to get multiple phone numbers separated by commas/// </summary>      /// <returns></returns>       Public stringGetmobile () {stringStrmobile ="";  for(inti =0; I < mobiles. Length; i++) {Strmobile+ = Mobiles[i] +","; }          if(Strmobile. Length >0) {Strmobile= Strmobile. Substring (0, Strmobile. Length-1); returnStrmobile; }          returnStrmobile; }           #endregion

The database gets:

      #regionMultiple phone numbers/// <summary>      ///Get the user phone number in the database get an array of multiple phone numbers separated by commas/// </summary>       Public stringGetmobilenumber () {stringStrmobilenumbers =""; DataTable DT=Jub. Get_mobile (MU.          Mobilenumber); //Read cell phone information data from the database//mobiles = dt. rows[0]["Mobilenumber"].          ToString (); //Defining Arrays          string[] Mobilenumbers =New string[dt.          Rows.Count]; if(dt. Rows.Count >0)          {              //Cyclic data               for(inti =0; i < dt. Rows.Count; i++) {DataRow Dr=dt.                  Rows[i]; Mobilenumbers[i]= dr["Mobilenumber"]. ToString ();//assigning values to arraysStrmobilenumbers + = Mobilenumbers[i] +","; }              if(Strmobilenumbers. Length >0) {strmobilenumbers= Strmobilenumbers. Substring (0, Strmobilenumbers. Length-1); returnstrmobilenumbers; }              returnstrmobilenumbers; }          returnstrmobilenumbers; }      #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.