Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Reformatting a string
Message
De
11/12/2007 22:09:49
 
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Versions des environnements
Environment:
VB 8.0
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01274953
Message ID:
01275023
Vues:
12
This message has been marked as a message which has helped to the initial question of the thread.
Is the .cs file in the same project as the rest of your code?
Is it in the same namespace?

>Craig
>
>Thanks for the input!! I put it in a separate class file, but it doesn't show up in intelisense, do you know how I would call it from another section of code? Thanks I know that's really a newby question, but I'm trying to figure out this C#.
>
>Thanks
>Kirk
>
>
>using System;
>using System.Collections.Generic;
>using System.Text.RegularExpressions;
>using System.Text;
>
>namespace SocketServer
>{
>    public class myFunctions
>    {
>        private string ReformatPhone(string phone)
>        {
>            Match m = Regex.Match(phone, @"^\(?(\d{3})\)?[\s\-]?(\d{3})\-?(\d{4})$");
>            return String.Format("{0}-{1}-{2}", m.Groups[1], m.Groups[2], m.Groups[3]);
>        }
>    }
>}
>
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform