473,725 Members | 2,212 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Split on tab character

I need to split on the tab character found in a string. What is used for the
character?
Nov 21 '05 #1
4 58904
Imports System.IO

Module Module1
Sub Main()
Dim reader As New StreamReader("c :\filename.txt" )

Dim oneLine As String = reader.ReadLine ()
While Not oneLine Is Nothing
Dim vals() As String = oneLine.Split(v bTab)

'Do something interesting with the array of strings
Dim s As String
For Each s In vals
Console.WriteLi ne(s)
Next

oneLine = reader.ReadLine ()
End While
End Sub
End Module

"Robert Strickland" <bs*********@co mporium.net> wrote in message
news:uy******** ******@TK2MSFTN GP12.phx.gbl:
I need to split on the tab character found in a string. What is used for
the
character?


Nov 21 '05 #2
Dim str As String = "This contains a" & vbTab & "Tab"

MessageBox.Show (str.Split(Cont rolChars.Tab)(0 ))
MessageBox.Show (str.Split(Cont rolChars.Tab)(1 ))

hope that helps..
Imran.

"Robert Strickland" <bs*********@co mporium.net> wrote in message
news:uy******** ******@TK2MSFTN GP12.phx.gbl...
I need to split on the tab character found in a string. What is used for the character?

Nov 21 '05 #3
That worked nicely.

Thanks

"scorpion53 061" <ad***@nospamhe rekjmsolutions. com> wrote in message
news:#F******** ******@TK2MSFTN GP09.phx.gbl...
Imports System.IO

Module Module1
Sub Main()
Dim reader As New StreamReader("c :\filename.txt" )

Dim oneLine As String = reader.ReadLine ()
While Not oneLine Is Nothing
Dim vals() As String = oneLine.Split(v bTab)

'Do something interesting with the array of strings
Dim s As String
For Each s In vals
Console.WriteLi ne(s)
Next

oneLine = reader.ReadLine ()
End While
End Sub
End Module

"Robert Strickland" <bs*********@co mporium.net> wrote in message
news:uy******** ******@TK2MSFTN GP12.phx.gbl:
I need to split on the tab character found in a string. What is used for
the
character?

Nov 21 '05 #4
"Robert Strickland" <bs*********@co mporium.net> schrieb:
I need to split on the tab character found in a string.
What is used for the character?


'ControlChars.T ab' or 'vbTab'.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 21 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
31177
by: Stu Cazzo | last post by:
I have the following: String myStringArray; String myString = "98 99 100"; I want to split up myString and put it into myStringArray. If I use this: myStringArray = myString.split(" "); it will split myString up using the delimiter of 1 space so that
2
21693
by: dont bother | last post by:
Hi Buddies, I am facing this problem and I dont know what to use as EOF in python: I want to read a file, and put all the individual words in a dictionary with their index: For example if the file is: Hello there I am doing fine How are you?
4
18295
by: qwweeeit | last post by:
The standard split() can use only one delimiter. To split a text file into words you need multiple delimiters like blank, punctuation, math signs (+-*/), parenteses and so on. I didn't succeeded in using re.split()...
3
2100
by: John Salerno | last post by:
This is an example in the book I'm reading: string fullName = " Edward C Koop "; fullName = fullName.Trim(); string names = fullName.Split(' '); string firstName = names; // Edward Two questions about this: 1. Why do you use single quotes with Split() instead of double? Is this
6
1753
by: | last post by:
How do I convert a single character, e.g. "a" into char for use in the 'split' command? p.s. I have option strict on Tia.
5
5874
by: kurt sune | last post by:
The code: Dim aLine As String = "cat" & vbNewLine & "dog" & vbNewLine & "fox" & vbNewLine Dim csvColumns1 As String() = aLine.Split(vbNewLine, vbCr, vbLf) Dim csvColumns2 As String() = Microsoft.VisualBasic.Strings.Split(aLine, vbNewLine, -1, CompareMethod.Binary)
10
5524
by: vunet.us | last post by:
Hello, I use XMLHTTP to get an HTML of another page. Then, I need to cut some middle part of that HTML string but I have problems doing it (see note in caps below). The error I have generated at response.write (because it does not split) is: Microsoft VBScript runtime error '800a0009' Subscript out of range: '' /get_item.asp, line 55
7
3492
by: Johny | last post by:
I have a string of a variable length and I need to split the string in strings of 6 characters . But if the 6th character is not space then I must split the string at possition before the 6th character. For example: if the main string S is S='abcde fghc ijkl mnop'
7
19338
by: Tom de Neef | last post by:
I need to change one character at a known position in a string. In Pascal I would change the P's character of a string S into 'x' with S:='x'; In JavaScript I come no further than S = S.substr(0,P-2)+'x'+S.substr(P) Is there really no more trivial way? I'm looking for the write equivalent of S.charAt(P). TIA Tom
0
6263
!NoItAll
by: !NoItAll | last post by:
For those of you who have graduated from VB6 to VB.NET; one of the things you have undoubtedly encountered is how functionality you expected to be the same, or similar to VB6 turned out completely different in VB.NET. One of those I recently encountered is the String Class Split method. In VB6 Split is a function: Dim MySplittableString as String MySplittableString = "one,two,three,four,five" Dim MyArray() as String MyArray =...
0
8752
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9257
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9113
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8097
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6702
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6011
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4784
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3221
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2157
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.