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 Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Searching text for a tab char

Status
Not open for further replies.

minckle

Programmer
Mar 17, 2004
142
GB
Hi
What is the best where to search through some text to find where the 'tab' key has been pressed?

e.g. if i was looking for a comma, I could use

MainString := 'Hi, How are you")

GetPosition := pos(',',MainString);
GetPosition := 3

but i want to find a tab
e.g

MainString := 'James Smith")

GetPosition := pos('tab',MainString); //this does not work
GetPosition := 6

is there a way a doing what i want to do???

Thanks

 
the ascii code for the tab is 9 so do this :

GetPosition := pos(#9,MainString);

--------------------------------------
What You See Is What You Get
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top