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.
Printable View
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.
Are you looking for the string "\n" or ControlChars.Lf
followed by a count of ControlChars.Tab
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.
Code:Dim numTabs As Integer = line.Length - line.TrimStart(ControlChars.Tab).Length