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.


>> REGISTER NOW TO START POSTING


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

Results 1 to 2 of 2

Thread: function to get the number of a .(period)

  1. #1
    Junior Member
    Join Date
    Mar 2013
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default function to get the number of a .(period)

    how we can get the number before the period..

    Example

    $123.45

    i want only 123, how can trim $ and .45



    Thanks
    SubbaRao


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    21,824
    Thanks
    55
    Thanked 2,344 Times in 2,315 Posts

    Default Re: function to get the number of a .(period)

    The String class has some methods that would be useful: indexof, substring and split (with a regexp)
    If you don't understand my answer, don't ignore it, ask a question.

Similar Threads

  1. Replies: 2
    Last Post: November 7th, 2012, 10:45 PM
  2. execute a method over a maximum period of time
    By PedroCosta in forum What's Wrong With My Code?
    Replies: 5
    Last Post: August 24th, 2011, 03:06 PM
  3. Remove from array after a period of time
    By Marty in forum Collections and Generics
    Replies: 1
    Last Post: September 1st, 2009, 08:57 AM
  4. Replies: 4
    Last Post: June 10th, 2009, 02:04 AM