Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Chrtran in .NET
Message
 
 
À
22/02/2013 13:35:19
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Titre:
Versions des environnements
Environment:
C# 3.0
OS:
Windows XP
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01360482
Message ID:
01566786
Vues:
50
>>>>So, assuming this is correct, how would I call it for the above case?
>>>>
>>>>Thanks again.
>>>
>>>
>>>Dunno
>>
>>:) I guess you let me figure this out. I'll try. I hope your function will work - should I make the number of spaces == length of all these chars combined?
>
>Dunno - haven't had a good look at it - sure you will test

Looks like I need to use empty string for the second parameter.
      String newValue = @"Testing
bad

chars" + (char)14 + " char(14) " + (char)12 + " char(12) " +  (char)31 + " char(31) Was the last char.";

            Console.WriteLine("{0}, Length = {1}",newValue, newValue.Length);

            StringBuilder invalidChars = new StringBuilder();

            for (int i = 0; i < 32; i++)
            {
                if (!i.InList(8, 9, 10, 13))
                    invalidChars.Append((char)i);
            }

            newValue = newValue.ChrTran(invalidChars.ToString(), "");

            Console.WriteLine("{0}, Length = {1}",newValue, newValue.Length);
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform