friendsterTalk - Friendster Forum

friendsterTalk - Friendster Forum

Welcome guest! Please Login or Register.

#1  2008-11-11 17:32:22

creamownedz
 active server protocol
creamownedz's display avatar
» FriendsterTalker
PsychoCoder
Class-S
Location: Ftalk & MCTF
Registered: 2008-03-22
Posts: 115
Last visit: Yesterday
Reputation: 7

Re-Write your PhoneNumber [C#]

Re-Write your PhoneNumber in the format of 123-456-7890


Code:

        private string ReWritePhoneNumber(String PhoneNumber)
        {
            System.Text.RegularExpressions.Regex expressions = new System.Text.RegularExpressions.Regex("^\\(?([1-9]\\d{2})\\)?\\D*?([1-9]\\d{2})\\D*?(\\d{4})$");
            System.Text.RegularExpressions.Match regex = System.Text.RegularExpressions.Regex.Match(PhoneNumber, expressions.ToString());
            return Convert.ToString(regex.Groups[1])+"-"+Convert.ToString(regex.Groups[2])+"-"+Convert.ToString(regex.Groups[3]);
        }

...Giving of reputation are highly appreciating for me...
Computers don't make errors what they do they do on purpose
...computer is my expertise...
....an addicted coder....
....don't ripp all my tutorials....

Search Friendstertalk

Board footer

FriendsterTalk is not affiliated with Friendster.com
Copyright © 2002–2009 PunBB

[ 8 queries - 2.917 second ]

Pay Per Click Ads by pay per click advertising by Kontera

FriendsterTalk.com x

Welcome to FriendsterTalk! You'll need to login in order to fully use all the features and view all the sections of this site.

Please register if you're not yet a member. =)