• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 208
  • Last Modified:

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

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', '');

Thanks.
0
lapucca
Asked:
lapucca
1 Solution
 
jbachmanNETCommented:
Hey,

try using this code:

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

Open in new window

0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now