Welcome to the Java Programming Forums

The professional, friendly Java community. 21,500 members and growing!

The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: How to ignore numbers after space

  1. #1

    Default How to ignore numbers after space

    In c++, I'm aware that you can use the ignore function to ignore numbers after space, but in string how do I ignore a number after space is found for instance, "109 33" how would I ignore 33?

  2. #2
    Senior Member PhHein's Avatar
    Join Date
    Mar 2013
    My Mood
    Thanked 93 Times in 86 Posts

    Default Re: How to ignore numbers after space

    With indexOf() you can find the index of the space char and then use substring() to get all chars before the space.

  3. #3
    Join Date
    Feb 2014
    My Mood
    Thanked 7 Times in 7 Posts

    Default Re: How to ignore numbers after space

    Or you can also use split function . That would break it in terms of space and store the result in arrays.

Similar Threads

  1. Working with numbers when there's "space" in between them
    By ashl7 in forum What's Wrong With My Code?
    Replies: 18
    Last Post: April 12th, 2013, 02:19 AM
  2. Replies: 1
    Last Post: July 28th, 2012, 12:05 AM
  3. how to ignore upper and lower case
    By mohamed_saleh2012 in forum Java Theory & Questions
    Replies: 1
    Last Post: March 10th, 2012, 03:49 PM
  4. Which files do I ignore in my version control?
    By ChristopherLowe in forum Android Development
    Replies: 1
    Last Post: January 5th, 2012, 11:39 PM
  5. How do I make this Palindrome tester ignore punctuation?
    By trogan234 in forum What's Wrong With My Code?
    Replies: 2
    Last Post: October 3rd, 2011, 04:43 AM