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

  • Home
  • SEARCH
  • 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 117005
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T03:16:03+00:00 2026-05-11T03:16:03+00:00

I am coding VB.NET in VS2008. I have a comma delimited string of numbers,

  • 0

I am coding VB.NET in VS2008.

I have a comma delimited string of numbers, i.e. 16,7,99,1456,1,3

I do this in VB:

Dim MyArr() As String = MyString.Split(',') 

Will MyArr keep the items in the order they were in the string?

If I do this:

For Each S as String in MyString.Split(',')     'Do something with S     'Will my items be in the same order they were     'in the string? Next 

I tested it and it appears to keep the sort order but will it ~always~ keep the order?

If it does not maintain the order then what is a good way to split a string and keep order?

I’m asking because MSDN Array documentation says: ‘The Array is not guaranteed to be sorted.’ So I’m a bit unsure.

  • 1 1 Answer
  • 2 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. 2026-05-11T03:16:04+00:00Added an answer on May 11, 2026 at 3:16 am

    Yes, in your example the items will stay in the original order.

    The MSDN documentation indicates that an Array is not necessarily sorted just because it’s an Array, but once the items are in the Array, they won’t be rearranged. The Split() operation will break it down based on the given token, preserving the order.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Does System.String.Split() ever return null ? (.NET) I know I've been coding in the
This problem is the bane of my asp.net coding life. I have a control,
Coding Platform: ASP.NET C# I have an XML like this. <Items> <Map id=35> <Terrains>
I am using visual studio 2008 coding asp.net.vb I have 20 images on my
I am a PHP programmer. I have no .Net coding experience (last seen it
Ok, this is painful for me because yes, I've been coding ASP.NET after classic
in asp.net 3.5[vs2008] Gridview i got one issue. i have binded objectdatasource with datagridview,
I have an experience with CakePHP and now started coding on ASP.NET MVC framework.
OS: Vista Business 64-BIT Coding: .NET and 3-rd party EXE Issue: Security I have
Coding Platform: ASP.NET 4.0 WebForms with C# We have a website with the existing

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.