|
-
Aug 9th, 2011, 11:01 AM
#1
Thread Starter
New Member
Count the number of tabs "\n"
Any idea how I can count the number of tabs embedded at the beginning of a line in a text file when im parsing the file.
thanks.
-
Aug 9th, 2011, 11:17 AM
#2
Re: Count the number of tabs "\n"
Are you looking for the string "\n" or ControlChars.Lf
followed by a count of ControlChars.Tab
-
Aug 9th, 2011, 11:25 AM
#3
Thread Starter
New Member
Re: Count the number of tabs "\n"
i thought i was looking for "\n" but not sure what COnrtolChars.Lf. Do you mind explaining it to me. Basically my goal is to parse a file and each line in the file has certain number of tabs (space) at the beginning of it. I am trying to count how many tabs cover that space for each line. thanks.
-
Aug 9th, 2011, 03:15 PM
#4
Re: Count the number of tabs "\n"
Code:
Dim numTabs As Integer = line.Length - line.TrimStart(ControlChars.Tab).Length
Last edited by David Anton; Aug 9th, 2011 at 03:20 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|