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 6980349
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T18:00:18+00:00 2026-05-27T18:00:18+00:00

Fluent googling doesn’t give an answer, so question is: Does String.Split method ensure order

  • 0

Fluent googling doesn’t give an answer, so question is:

Does String.Split method ensure order of resulted substrings in according to they position in initial string?

  • 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-27T18:00:19+00:00Added an answer on May 27, 2026 at 6:00 pm

    According to what ILSpy shows on the internals of string.Split, the answer is yes.

    private string[] InternalSplitKeepEmptyEntries(
        int[] sepList, int[] lengthList, int numReplaces, int count)
    {
        int num = 0;
        int num2 = 0;
        count--;
        int num3 = (numReplaces < count) ? numReplaces : count;
        string[] array = new string[num3 + 1];
        int num4 = 0;
        while (num4 < num3 && num < this.Length)
        {
            array[num2++] = this.Substring(num, sepList[num4] - num);
            num = sepList[num4] + ((lengthList == null) ? 1 : lengthList[num4]);
            num4++;
        }
        if (num < this.Length && num3 >= 0)
        {
            array[num2] = this.Substring(num);
        }
        else
        {
            if (num2 == num3)
            {
                array[num2] = string.Empty;
            }
        }
        return array;
    }
    

    All elements (e.g. the array variable) are always processed in ascending order and no sorting occurs.

    The MSDN documentation for string.Split also lists examples which have results in the same order as their order in the original string.

    As Jim Mischel points out above, this is only the current implementation, which might change.

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

Sidebar

Related Questions

Fluent NHibernate doesn't like this, throwing an error: {Association references unmapped class: System.String} OK
In Fluent NHibernate, References() returns an object which doesn't support the 'ReadOnly()' method. I'm
Does Fluent NHibernate has a simple method for automapping entities? Let's say I have
This is a Fluent NHibernate newbie question, so bear with me. I have a
Question follows on from Fluent NHibernate + multiple databases (no need to follow this
I updated to fluent nhibernate 1.2 and now some of my stuff does not
//window[Fluent][Include] function setGlobalVariableByName(name,value) { var indexes = name.split(.); var variable = null; $.each(indexes, function()
Using Fluent Interface design here if i call something like dog.Train(Running).Train(Eating).Do(Running).Do(Eating); what is the
I am using Fluent NHibernate and having some issues getting a many to many
Can I use Fluent NHibernate API for .NET 2.0 applications.

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.