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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T04:55:08+00:00 2026-06-17T04:55:08+00:00

right now I am a little bit confused. I want to manipulate this string

  • 0

right now I am a little bit confused. I want to manipulate this string with a tokenizer:

Bob:23456:12345 Carl:09876:54321

However, I use a Tokenizer, but when I try:

      String signature1 = tok.nextToken(":");             
      tok.nextToken(" ")

I get:

12345 Carl

However I want to have the first int and the second int into a var.

Any ideas?

  • 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-17T04:55:09+00:00Added an answer on June 17, 2026 at 4:55 am

    You have two different patterns, maybe you should handle both separated.

    Fist you should split the space separated values. Only use the string split(" "). That will return a String[].

    Then for each String use tokenizer.

    I believe will works.

    Code:

    String input = "Bob:23456:12345 Carl:09876:54321";
    String[] words = input.split(" ")
    
    for (String word : words) {
      String[] token = each.split(":");
    
      String name = token[0];
      int value0 = Integer.parseInt(token[1]);
      int value1 = Integer.parseInt(token[2]);    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm a little bit confused right now, if I put this jquery on my
I'm a bit confused right now and just want to ask you all to
I am a little bit confused right now...in the CakePHP documentation, it states that
I'm learning this right now so the questions might be a little juvenile. Here's
so I'm in a little over my head right now and want to verify
My php is a little rusty but this is boggling my mind right now.
I googled this a little but couldn't find a good result. Right now I'm
I'm coding smt right now, and am a little bit peeved by the fact
I am a little bit tired right now (out of coffee), so I am
I'm getting a little bit crazy right now. My company switched from VS2008 to

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.