Link to home
Create AccountLog in
Avatar of VBdotnet2005
VBdotnet2005Flag for United States of America

asked on

tab in C#

dim test as string = "This is a test" & vbtab
string test = "This is a test" + \t;   keeps saying ")expected
Avatar of cyberkiwi
cyberkiwi
Flag of New Zealand image

string test = "This is a test\t";
Avatar of VBdotnet2005

ASKER

result I get is >>This is a test\t<<
this is in asp.net webpage
string test = "This is a test\t";

Is not the same as

string test = @"This is a test\t";   // literal with no expansion of escape characters

If you see it in the debugger, it may still show \t.
Or it may have something to do with your rendering code, what is displaying the content of test to the web page? AFAIK, unless the tab is in a <PRE> tag on a web page, it has no meaning.
How about this ?
"this" & vbtab & "is" & vbtab & "a" & vbtab & "test"  
VB: "this" & vbtab & "is" & vbtab & "a" & vbtab & "test"
c#: "this\tis\ta\ttest"

Just one site that shows how tab is expressed in C#
http://forums.devx.com/archive/index.php/t-16471.html
dim test as string = "VB"
dim test2 as stromg = "C#"
dim test3 as string = test & vbtab & test2

c# would be this

string test = "VB";
string test2 = "C#";
string test3 = test\t\test2;  ?
ASKER CERTIFIED SOLUTION
Avatar of cyberkiwi
cyberkiwi
Flag of New Zealand image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
thanks