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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T09:49:40+00:00 2026-06-02T09:49:40+00:00

I’m working on something relatively simple (or so I thought) and need a bit

  • 0

I’m working on something relatively simple (or so I thought) and need a bit of help.

I am trying to create a dynamic amount of comma separated strings.

I have a variable (numberOfStrings) which is the number of different strings I need.
I just want to loop thru the aryDrivers and assign then to the different strings.

Dim aryHeats(numberOfStrings - 1) As ArrayList

Dim aryDrivers() As String
aryDrivers = txtBatch.Text.Split(",")

For i As Integer = 0 To aryDrivers.Length - 1
    For j As Integer = 0 To aryHeats.Length - 1
        aryHeats(j).Add(aryDrivers(i) & ",")
    Next
Next

For some reason I’m getting an error in the loop when I try to “ADD” the string.

Thoughts?

Thanks!

** Update **

Maybe this will help explain more what I’m trying to do.
I have a string:

s = A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z

i’m passing a variable (numberOfHeats) lets use 4.

i would like to then have 4 strings (so I am wanted to use array)

ary(0) = A,E,I,M,Q,U,Y
ary(1) = B,F,J,N,R,V,Z
ary(2) = C,G,K,O,S,W
ary(3) = D,H,L,P,T,X

hopefully that clears this up.

  • 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-06-02T09:49:42+00:00Added an answer on June 2, 2026 at 9:49 am

    You could use LINQ, although i hate VB.NET method syntax:

    Dim text = "A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z"
    Dim numberOfHeats = 4
    Dim aryHeats As String()() = s.Split(","c).
            Select(Function(w, index) New With {.Word = w, .Index = index}).
            GroupBy(Function(x) x.Index Mod numberOfHeats).
            Select(Function(grp) grp.Select(Function(x) x.Word).ToArray()).
            ToArray()
    

    Explanation: it takes the initial string and split it in words (comma as separator). Then it transforms the word and the according index in the String-Array to an anonymous type with Word and Index as properties. This list will be grouped by Index Mod numberOfHeats(the number of arrays you want). This implicitely orders by your desired result. The last step is to transform the groups to a jagged array.

    Result:

    (0) 
        (0) "A" 
        (1) "E" 
        (2) "I" 
        (3) "M" 
        (4) "Q" 
        (5) "U" 
        (6) "Y" 
    (1) 
        (0) "B" 
        (1) "F" 
        (2) "J" 
        (3) "N" 
        (4) "R" 
        (5) "V" 
        (6) "Z" 
    (2)     
        (0) "C" 
        (1) "G" 
        (2) "K" 
        (3) "O" 
        (4) "S" 
        (5) "W" 
    (3) 
        (0) "D" 
        (1) "H" 
        (2) "L" 
        (3) "P" 
        (4) "T" 
        (5) "X"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Basically, what I'm trying to create is a page of div tags, each has
I'm trying to create an if statement in PHP that prevents a single post
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I am trying to understand how to use SyndicationItem to display feed which is
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
Seemingly simple, but I cannot find anything relevant on the web. What is the
In my XML file chapters tag has more chapter tag.i need to display chapters
I am doing a simple coin flipping experiment for class that involves flipping a
I am trying to render a haml file in a javascript response like so:

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.