Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6124361
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T16:07:27+00:00 2026-05-23T16:07:27+00:00

Okay, so in a program I’m working on in VB.NET I’m trying to make

  • 0

Okay, so in a program I’m working on in VB.NET I’m trying to make it so I can take in a list of strings (each on a different line). For each line I want to take in the line, and break it up into three parts. The first part goes from the beginning of the string to the first colon in the string, the second part goes from the first colon to the at symbol, and the last part goes from the at symbol to the end of the string.

For example, I’d take in a line of the series of lines:
hello:world@yay

I’d want to break it into three separate strings of “hello”, “world”, and “yay”.

How would I do such a thing in VB.NET?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T16:07:28+00:00Added an answer on May 23, 2026 at 4:07 pm

    You can accomplish this with a Split. For example purposes, I am re-splitting a string which I could have saved off, so I wouldn’t have to Split it again. However, it’s simpler to understand this way:

    Dim s as String = "hello:world@yay" 'This can be a string from a loop.
    Dim hello As String = s.Split(":")(0)  'Get everything before colon.
    Dim world As String = s.Split(":")(1).Split("@")(0) 'Get everything after colon, and split the result again, grabbing everything before the amp.
    Dim yay As String = s.Split(":")(1).Split("@")(1) 'Get everything after colon, and split the result again, grabbing everything after the amp.
    

    If you’re reading from a text file, e.g.

        Dim objReader As New StreamReader("c:\test.txt")
        Dim s As String = ""
        Dim hello As String
        Dim world As String
        Dim yay As String
    
        Do
            s = objReader.ReadLine()
            If Not s Is Nothing Then
               hello = s.Split(":")(0)
               world = s.Split(":")(1).Split("@")(0)
               yay = s.Split(":")(1).Split("@")(1)
            End If
        Loop Until s Is Nothing
        objReader.Close()
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Okay so I'm trying to make a little gag program that will run away
Okay, so ultimately I want a program where the user can input simple data
Okay so I'm trying to make a file browser program, and I'm in the
Okay, I have this program and I don't want more than one instance of
Okay, I am working on a card playing program, and I am storing card
Okay, so I'm working on a project where I use a Java program to
Okay, I know you can have a program keep running while a certain condition
Okay, I want to use SourceForge to host my source for a program, but
Okay so I am trying to make a histogram from a three dimensional array
Okay, So I have been all over the net trying to find ways to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.