• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to retrieve the number of used “/n”

 
chen young
Ranch Hand
Posts: 197
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
use string.split with the -1 parameter
 
chen young
Ranch Hand
Posts: 197
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic