print non-printable characters in a given string?

.net, c#, visual-studio, visual-studio-2010

Solution

You can use `char.IsControl(c)` to test whether a character is a control (non-printable) character or not:

foreach (var c in str)
{
    if (char.IsControl(c))
    {
        Console.WriteLine("Found control character: {0}", (int)c);
    }
}

Problem

I've a string, In sql I've tested this string contains non-printable characters but I couldn't find which are those. So can anyone suggest me how can i find and print those non-printable characters in C# by passing this string? I ordered a Taurus in August and it hasn't been scheduled, I was just wondering if there is something wrong with the order? Or if the queue is just long? Order Number:8028Vehicle Rep:74JTag#: 200L049Description: 2011 TAURUS FWD SELOrdered: 08-AUG- 2010VIN Assigned:VIN#:Scheduled:In Production:Produced:Invoiced:Released:Shipped:Ready:Tax Location: STATE OF MICHIGAN (20 )State Insured:USOB Status:050 - CLEAN UNSCHEDULED ORDER As i pasted the string in notepad++ it shows like this.

Original source