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

The Archive Base Latest Questions

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

How could one populate a 2d array from a text file using split? String

  • 0

How could one populate a 2d array from a text file using split?

String proxies[][] = {{"127.0.0.1","80"}, {"127.0.0.1","443"}, {"127.0.0.1","3306"}};

In my text file I have data with a ip:port on each line:

127.0.0.1:80
127.0.0.1.443
127.0.0.1.3306

I could populate a 1d array using split like this:

proxies = everyLine.split("\\n");

How would I insert the ip:port data into a 2d array?

  • 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:34:45+00:00Added an answer on May 23, 2026 at 4:34 pm
        String[] lines = everyLine.split("\\n");
        String[][] proxies = new String[lines.length][];
        int i=0;
        for ( String line : lines )
        {
            proxies[i++] = line.split(":");
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string array and i need to populate its value to a
Could any one please tell me the meaning of ++ with array in the
When i do traceroute from one solaris m/c to another using 10 gig network
I would like to return an array of strings from C to Java using
How could one test whether a set of modules is installed, given the names
Could any one give an explanation on how a DHT works? Nothing too heavy,
Could some one tell me how to capture SOAP messages passed between the client
Could any one suggest good Python-related podcasts out there, it could be anything about
Could any one tell me how to enable SOCKET support in PHP ?
Could some one guide me to create a APS logon token in .Net programmatically?

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.