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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T23:02:35+00:00 2026-06-02T23:02:35+00:00

I am trying to transfer values from each line of a multi line text

  • 0

I am trying to transfer values from each line of a multi line text box into either a string array or a multidimensional array. I also have 3 multi-line text boxes which need to put into the same array. Below is one of the methods I have been trying:

ParkingTimes[0] = tbxtimeLimitS1.Text;

for (int i = 1; i <= 10; i++)
   ParkingTimes[i] = tbxparkingTimesS1.Lines;

ParkingTimes[11] = tbxtimeLimitS2.Lines;

for (int x = 0; x <= 10; x++)
   for (int i = 12; i <= 21; i++)
       ParkingTimes[i] = tbxparkingTimesS2.Lines;

ParkingTimes[11] = tbxtimeLimitS2.Lines[0];

for (int x = 0; x <= 10; x++)
    for (int i = 23; i <= 32; i++)
        ParkingTimes[i] = tbxparkingTimesS3.Lines;

What am I doing wrong? Is there a better way to accomplish this?

  • 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-02T23:02:37+00:00Added an answer on June 2, 2026 at 11:02 pm

    You could use a List instead of a string array
    Then the AddRange method could simplify your method eliminatig the foreach loop

    List<string> ParkingTimes = new List<string>()
    ParkingTimes.Add(tbxtimeLimitS1.Text);   
    ParkingTimes.AddRange(tbxparkingTimesS1.Lines);
    ParkingTimes.AddRange(tbxtimeLimitS2.Lines);   
    ParkingTimes.AddRange(tbxparkingTimesS2.Lines);   
    ParkingTimes.AddRange(tbxtimeLimitS2.Lines);   
    ParkingTimes.AddRange(tbxparkingTimesS3.Lines);   
    

    If your code still requires a string array it is possible to get back the array with

    string[] myLines = ParkingTimes.ToArray();
    

    An example of this List<string> functionality could be found on MSDN here

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

Sidebar

Related Questions

I am trying to transfer a variable from the URL into a contact form
I'm trying to transfer some data from Access to SQL Server 2000 (there are
So I'm trying to do a Server.Transfer from a generic handler to an regular
I'm trying to read the POST data from a request with Transfer-Encoding: chunked while
I am trying to transfer data from a jsp file using a json object.
I'm trying to use ASIFormDataRequest for iphone to get some values from my mysql
I am trying to transfer data from one page to another but some problem
I am trying to generate a transfer function from the state space matrices that
I am trying to import data from a column in a .xslx file into
I'm trying to transfer the contents of one list to another, but it's not

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.