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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T01:31:16+00:00 2026-05-22T01:31:16+00:00

Hi in my program a string is generated like 1&area_id=54&cid=3 .First an integer and

  • 0

Hi in my program a string is generated like "1&area_id=54&cid=3".First an integer and then a string "&area_id=",then antoher integer, and after that a string “&cid=” and then the final integer.These two strings are always same.But integer is changing.How to write split function so that i can find these three integers in three variable or with in an array.I can seperate these by looping but i want to use split function.Thanks

  • 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-22T01:31:17+00:00Added an answer on May 22, 2026 at 1:31 am

    How about

    string.split("&\\w+=")
    

    This works with your example:

    System.out.println(Arrays.asList("1&area_id=54&cid=3".split("&\\w+=")));
    

    outputs

    [1, 54, 3]
    

    The call to string.split("&\\w+=") reads in English: Split string on every match for the regular expression parameter, and then return all substrings in between the matched tokens as an array.

    The regular expression reads: Match all substrings starting with "&", followed by at least ("+") one word-character ("\\w", i.e. letters, digits, and some special characters, such as the underscore from your example), followed by "=". For more details see the Javadoc for java.util.regex.Pattern

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

Sidebar

Related Questions

If I have a string formatting program in C, that consists of only one
Let's say my program is always passed a string of characters that represents a
I have several expressions I have generated in Mathematica that I would like to
We have XML generated from an external program that needs to be read into
In my program I generate classes dynamically but when I try: String[] args =
class Program { static void Main(string[] args) { String value = Two; Type enumType
class Program { static void Main(string[] args) { List<Book> books = new List<Book> {
The program needs to take in a simple string from the user and display
In the below program: class Main { static string staticVariable = Static Variable; string
Consider following program: static void Main (string[] args) { int i; uint ui; i

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.