A friendly place for programming greenhorns!
Big Moose Saloon
Search
|
Java FAQ
|
Recent Topics
Register / Login
Win a copy of
Arduino in Action
this week in the
General Computing
forum!
A special promo:
Enter your blog post or vote on a blogger to be featured in an upcoming Journal
JavaRanch
»
Java Forums
»
Java
»
Beginning Java
Author
How to retrieve the number of used “/n”
chen young
Ranch Hand
Joined: Sep 09, 2005
Posts: 178
posted
Mar 17, 2009 03:54:27
0
Hi,
Is there a way to retrieve the number of used “/n” in a
string
?
For example if I have the following string:
--------------------------------------------- START SCAN server.log.1 ---------------------------------------------
2009-01-20 09:48:35,667 [kit]DEBUG
The original was like this: --------------------------------------------- START SCAN server.log.1 ---------------------------------------------+“\n”+2009-01-20 09:48:35,667 [kit]DEBUG+”\n”
Used “\n” = 2
Thanks
Michael Dunn
Ranch Hand
Joined: Jun 09, 2003
Posts: 4632
posted
Mar 17, 2009 04:03:02
0
use string.split with the -1 parameter
chen young
Ranch Hand
Joined: Sep 09, 2005
Posts: 178
posted
Mar 17, 2009 05:42:42
0
thanks
subject: How to retrieve the number of used “/n”
Similar Threads
can not deploy application!!!!
Transaction failure crashes program
Formlogin/Apache/SSL
Null pointer exception probably due to synchronisation issues; problem in starting activity
Jboss Messaging- Machine with Two LAN cards not able to receive meessage
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter