Lasso Soft Inc. > Home

[lp_string_linefeedGet]

Linklp_string_linefeedGet
AuthorBil Corry
CategoryString
Version8.x
LicensePublic Domain
Posted03 Dec 2005
Updated03 Dec 2005
More by this author...

Description

Returns the line ending in a string.  Returns empty string if no line ending is found.

Sample Usage

[var:'test' = 'line_1\rline_2\rline_3\r']
String: [output: $test,-encodeurl]

Linefeed: [output: (lp_string_linefeedGet:$test),-encodeurl]

Source Code

Click the "Download" button below to retrieve a copy of this tag, including the complete documentation and sample usage shown on this page. Place the downloaded ".inc" file in your LassoStartup folder, restart Lasso, and you can begin using this tag immediately.

[

define_tag:'lp_string_linefeedGet',
	-description='Returns the line ending in a string.',
	-priority='replace',
	-required='string';

	// returns linefeed used
	if: #string->(find:'\r\n') > 0;
		return:'\r\n';
	else: #string->(find:'\r') > 0;
		return:'\r';
	else: #string->(find:'\n') > 0;
		return:'\n';
	else; //unknown or lf not found
		return: '';
	/if;

/define_tag;

]

Comments

No comments

Please log in to comment

Subscribe to the LassoTalk mail list

LassoSoft Inc. > Home

 

 

©LassoSoft Inc 2015 | Web Development by Treefrog Inc | PrivacyLegal terms and Shipping | Contact LassoSoft