The Daily Click ::. Forums ::. Klik Coding Help ::. Can you retrieve how many lines in a String Object?
 

Post Reply  Post Oekaki 
 

Posted By Message

Chris Burrows



Registered
  14/09/2002
Points
  2396

GOTW WINNER OCT. 2011
30th August, 2011 at 20:12:45 -


Can you retrieve how many lines in a String Object? For example, here is a string:

"Mary had a little lamb
Little lamb little lamb
Mary had a little lamb
and it's fleece was white as snow"

Is it possible to retrieve a line value of 4? Something along the lines of: Set Counter1 to TotalLines(String1)

Thank you for your help

 
n/a

UrbanMonk

BRING BACK MITCH

Registered
  07/07/2008
Points
  49667

Has Donated, Thank You!Little Pirate!ARGH SignKliktober Special Award TagPicture Me This Round 33 Winner!The Outlaw!VIP MemberHasslevania 2!I am an April FoolKitty
Picture Me This Round 32 Winner!Picture Me This Round 42 Winner!Picture Me This Round 44 Winner!Picture Me This Round 53 Winner!
30th August, 2011 at 22:45:35 -

String Parser 2 object can do this.

First "Set source string" to the string you would like to count the lines of then

Add newline$ as a delimiter like this:
Image

Then use the following expression to get the number of lines:
Image

 
n/a

Chris Burrows



Registered
  14/09/2002
Points
  2396

GOTW WINNER OCT. 2011
31st August, 2011 at 03:57:19 -

Thanks UrbanMonk!

Your screenshots are great too!

 
n/a
   

Post Reply



 



Advertisement

Worth A Click