Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Finding Vertical tab in string 2

Status
Not open for further replies.

Bujitsu

MIS
Oct 23, 2003
67
AU
Hi,

I have a vertical tab in a string. How do I find it??
Hex 41, i think. It shows up in the string as \t.

I have tried string.Substring with '\t' and \t and "\t".
But no luck.

Any help would be great.
Thanks
 
Sorry everyone,

I meant to say "Horizontal Tab".

Cheers
 
There are a lot of different ways to do this. The method you choose also depends on what exactly you are trying to do.

I will list one method and from there you should be able to figure the rest out. The following is an example to find you the position (zero based index) of the first occurance of \t

Code:
string test = "this is\ta test";
int pos = test.IndexOf('\t');

pos should now equal 7.
 
And here is another
Code:
Match MyRegMatch = Regex.Match(_input,"\t"); 
if(MyRegMatch.Success)  
{
   you do have a tab
}
Marty
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top