C # How to set a field number how to cover several special symbols in the middle

Source: Internet
Author: User

To achieve the mobile phone number, ID card number, mail, and other special signs such as the star cover function for privacy protection, the effect is as follows 136****0000 322300*******32432143

Ditto (24TT lottery software setup and operation):

1   /// <summary>2         ///generate a cover field by length such as * * *3         /// </summary>4         /// <param name= "Program_starlen" >length as 4</param>5         /// <param name= "Program_starchar" >cover symbols such as *</param>6         /// <returns></returns>7          Public Static stringStarcharshow (intProgram_starlen,stringProgram_starchar)8         {9             stringProgram_starcharshow ="";Ten              for(inti =0; i < Program_starlen; i++) One             { AProgram_starcharshow = Program_starcharshow +Program_starchar; -             } -             returnprogram_starcharshow; the         } -         /// <summary> -         ///Special Sign Cover -         /// </summary> +         /// <param name= "str" >pseudo-obscure word embox field</param> -         /// <param name= "Program_starbegin" >Start bit</param> +         /// <param name= "Program_starend" >End Bit</param> A         /// <param name= "Program_starcharshow" >Masking combination Symbols</param> at         /// <returns></returns> -          Public Static stringStrreplacebystar (stringStrintProgram_starbegin,intProgram_starend,stringProgram_starchar) -         { -             stringNewstr =""; -             stringA =""; -             stringb =""; in             intstarlen=program_starend-program_starbegin+1; -             if(Starlen <=0) to             { +                 returnstr; -             } the             stringprogram_starcharshow=starcharshow (Starlen, Program_starchar); *             if(str. Length <=program_starend) $             {Panax Notoginseng                 if(str. Length <program_starbegin) -                 { theA =str; +                 } A                 Else the                 { +A = str. Substring (0, Program_starbegin-1); -                 } $             } $             Else -             { -A = str. Substring (0, Program_starbegin-1); theb = str. Substring (Program_starend, str. Length-program_starend); -             }WuyiNewstr = a + Program_starcharshow +b; the             returnNewstr; -         } Wu         /// <summary> -         ///Special Sign Cover About         /// </summary> $         /// <param name= "str" >pseudo-obscure word embox field</param> -         /// <param name= "Program_starbegin" >Start bit</param> -         /// <param name= "Program_starend" >End Bit</param> -         /// <param name= "Program_starchar" >Mask Symbol Single</param> A         /// <returns></returns> +          Public Static stringStrreplacebystars (stringStrintProgram_starbegin,intProgram_starend,stringprogram_starcharshow) the         { -             stringNewstr =""; $             stringA =""; the             stringb =""; the             if(str. Length <=program_starend) the             { the                 if(str. Length <program_starbegin) -                 { inA =str; the                 } the                 Else About                 { theA = str. Substring (0, Program_starbegin-1); the                 } the             } +             Else -             { theA = str. Substring (0, Program_starbegin-1);Bayib = str. Substring (Program_starend, str. Length-program_starend); the             } theNewstr = a + Program_starcharshow +b; -             returnNewstr; -}

C # How to set a field number how to cover several special symbols in the middle

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.