Posted By
|
Message
|
Chris Burrows
Registered 14/09/2002
Points 2396
|
30th August, 2011 at 21:02:25 -
Is it possible to search a string for an empty line? And return a true or false value?
Example 1 (has empty line):
"HELLO MY
NAME
IS CHRIS"
Example 2 (does NOT have empty line):
"HELLO MY
NAME
IS CHRIS"
n/a
|
UrbanMonk BRING BACK MITCH
Registered 07/07/2008
Points 49667
|
30th August, 2011 at 22:37:33 -
Yes it is.
Use:
-Find(string$( "String" ), NewLine$+NewLine$, 0)
Where "string$("String")" is the string you're testing.
It will return -1 if there are no empty lines.
However this method only detects empty lines within the content.
To detect a empty line on the end of the string:
-Compare two general values
right$(string$("String"),1) <> newline$
Edited by UrbanMonk
n/a
|
Chris Burrows
Registered 14/09/2002
Points 2396
|
31st August, 2011 at 03:55:15 -
Thanks UrbanMonk!
I've been experimenting and it seems Find(string$( "String" ),"your search here" , 0) will return the character value.
For example, here is a string:
Handgun Bullets
Lighter
Instant Coffee
Find(string$( "String" ), "Lighter", 0) will return a value of 17. The word "Lighter" begins at the 17th character in the string.
Is it possible to retrieve a line number instead?
n/a
|
|
|