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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T04:44:21+00:00 2026-06-10T04:44:21+00:00

Basically I have these connection strings that I need to split up, heres an

  • 0

Basically I have these connection strings that I need to split up, heres an example of one:

name=type,info1;101;localhost;-1;false;false

I want to split it up into three variables: name, type and info.

the name is the bit before the ‘=’ (“name”)
the type is the bit after the ‘=’ and before the ‘,’ (“type”)
the info is everything after the ‘,’ (“info1;101;localhost;-1;false;false”)

I have tried using the “.split” function but to no avail. Could anybody help me do it using a regular expression with substrings? Thanks.

Not had much practise with the split function, so it went like this:

String name [] = connString.split(",");
String type [] = connString.split(";");
String info [] = connString.split("");

MORE:

could you use the ‘.split’ method to split up the parameters in this line from an XML doc?

 <rect x="298.43" width="340.00" y="131.12" height="380.00" id="rect_1" style="stroke-width: 1; stroke: rgb(0, 0, 0); fill: rgb(255, 102, 0); "/>
  • 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-10T04:44:22+00:00Added an answer on June 10, 2026 at 4:44 am

    Using only one .split():

    String s = "name=type,info1;101;localhost;-1;false;false";
    String[] words = s.split("=|,");
    String name = words[0];
    String type = words[1];
    String info = words[2];
    System.out.println("Name: " + name + "\nType: " + type + "\nInfo: " + info);
    

    Output:

    Name: name
    Type: type
    Info: info1;101;localhost;-1;false;false
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I basically have a program that filters records from one excel file to another
How can I do a count distinct selection? Basically I have all these charges
So! Basically I have a database with a load of blog posts, these are
We have two separate web-apps, say 'retailUI' and 'bulkUI'. These two are basically two
Okay basically here's where I'm at. I have a list of PropertyDescriptor objects. These
Is there any name for the following DB table design: Basically we have generic
I have some localization problems in my webpage. There are basically two problems (that
I have an Entity result of List<string> GetTagsData that I need to somehow bind
I have the need to continuously build large strings in a loop and save
I need help with my program. So I have com port connection ( gps

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.