How can I replace all the tab char, '\t', in a string to nothing?

Posted on 2009-04-15
Last Modified: 2012-05-06
Hi, I'm using VS2008 and .net 3.5
I tried the following but that doesn't remove the \t, tab, from the string.  
questionText = questionText.Replace(@"\t","" ');
I tired using replace char but it doesn't allow a empaly char, ''
questionText = questionText.Replace('\t', '');

Question by:lapucca
    1 Comment
    LVL 1

    Accepted Solution


    try using this code:

    // tab-character
    char tab = '\u0009';
    questionText  = questionText .Replace(tab.ToString(), "    ");

    Open in new window


    Featured Post

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    Join & Write a Comment

    Article by: Ivo
    C# And Nullable Types Since 2.0 C# has Nullable(T) Generic Structure. The idea behind is to allow value type objects to have null values just like reference types have. This concerns scenarios where not all data sources have values (like a databa…
    It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    730 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now