Help with searching numbers

V

Vishwas

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
 
A

Andrew Thompson

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

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
 
R

Remon van Vliet

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
 
J

John Currier

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

John
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top