Help with searching numbers

Discussion in 'Java' started by Vishwas, Jun 16, 2005.

  1. Vishwas

    Vishwas Guest

    i have a problem, i have to a string of characters starting with
    numbers, i have to search for this no and whenever a no is encountered
    put a newline before it so tht all the strings starting with no r on a
    new line. plz help for this code
     
    Vishwas, Jun 16, 2005
    #1
    1. Advertising

  2. On 16 Jun 2005 04:20:20 -0700, Vishwas wrote:

    > i have a problem, i have to a string of characters starting with
    > numbers, i have to search for this no and whenever a no is encountered
    > put a newline before it so tht all the strings starting with no r on a
    > new line.


    <http://home.earthlink.net/~patricia_shanahan/beginner.html>

    >..plz help for this code


    It does not generally work the way you might be
    thinking, so I will explain.

    - people here will not provide you with the answer, though
    they may be willing to help.
    - It is best to supply some code (even code that does not
    compile) and a single question.
    - the best group for beginner questions can be found here..
    <http://www.physci.org/codes/javafaq.jsp#cljh>
    - if you have not done it already, do a 'HelloWorld' program.

    HTH

    --
    Andrew Thompson
    http://www.PhySci.org/codes/ Web & IT Help
    http://www.PhySci.org/ Open-source software suite
    http://www.1point1C.org/ Science & Technology
    http://www.LensEscapes.com/ Images that escape the mundane
     
    Andrew Thompson, Jun 16, 2005
    #2
    1. Advertising

  3. Example :

    yourString.replace(Integer.toString(yourNumber), '\n' +
    Integer.toString(yourNumber));

    Be careful that you're not trying to replace number 14 if numbers such as
    144 are also in there. If the numbers are seperated by delimiters make sure
    you add those to the search expression.

    All that said, this is very basic functionality easily found in the Java
    docs, you may wanna consider browsing that before you post questions here.
    Just a thought ;)

    Remon van Vliet

    "Vishwas" <> wrote in message
    news:...
    > i have a problem, i have to a string of characters starting with
    > numbers, i have to search for this no and whenever a no is encountered
    > put a newline before it so tht all the strings starting with no r on a
    > new line. plz help for this code
    >
     
    Remon van Vliet, Jun 16, 2005
    #3
  4. Vishwas

    John Currier Guest

    It looks an awful lot like someone's homework assignment....someone who
    has been spending too much time instant messaging.

    John
     
    John Currier, Jun 17, 2005
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Subra
    Replies:
    25
    Views:
    1,195
    user923005
    Mar 8, 2007
  2. Andrew Tatum

    Fibonacci Numbers and Lucas Numbers

    Andrew Tatum, May 26, 2007, in forum: C++
    Replies:
    6
    Views:
    567
    Howard
    May 27, 2007
  3. Lance Hoffmeyer
    Replies:
    2
    Views:
    524
    Lance Hoffmeyer
    Jul 26, 2007
  4. GIMME
    Replies:
    5
    Views:
    188
    Thomas 'PointedEars' Lahn
    Jul 26, 2004
  5. stumblng.tumblr
    Replies:
    1
    Views:
    209
    stumblng.tumblr
    Feb 4, 2008
Loading...

Share This Page