File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes How to retrieve the number of used “/n” Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "How to retrieve the number of used “/n”" Watch "How to retrieve the number of used “/n”" New topic
Author

How to retrieve the number of used “/n”

chen young
Ranch Hand

Joined: Sep 09, 2005
Posts: 190
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
use string.split with the -1 parameter
chen young
Ranch Hand

Joined: Sep 09, 2005
Posts: 190
thanks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to retrieve the number of used “/n”