Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Chrtran in .NET
Message
 
 
To
22/02/2013 13:35:19
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Title:
Environment versions
Environment:
C# 3.0
OS:
Windows XP
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01360482
Message ID:
01566786
Views:
49
>>>>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
Previous
Reply
Map
View

Click here to load this message in the networking platform