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
Andrew Thompson - 16 Jun 2005 12:40 GMT
> 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

Signature
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
Remon van Vliet - 16 Jun 2005 13:11 GMT
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
> 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
John Currier - 17 Jun 2005 00:46 GMT
It looks an awful lot like someone's homework assignment....someone who
has been spending too much time instant messaging.
John