Lasso Soft Inc. > Home

[lp_string_zap]

Linklp_string_zap
AuthorBil Corry
CategoryString
Version8.x
LicensePublic Domain
Posted18 Jan 2006
Updated18 Jan 2006
More by this author...

Description

Returns a string with all non-plain-ascii characters removed.

Sample Usage

[var:'teststring' = 'test test 123\t123' + (decode_url:'%80') + (decode_url:'%81')]
Test String: ([$teststring])
Zap (remove bad chars): ([lp_string_zap: $teststring])
Zap (replace bad chars with *): ([lp_string_zap: $teststring, '*'])

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_zap',
	-description='Returns a string with all non-plain-ascii characters removed.',
	-priority='replace',
	-required='text_to_zap',
	-optional='replacement_text';

	if: !(local_defined:'replacement_text');
		local:'replacement_text' = '';
	/if;

	return: (string_replaceregexp: #text_to_zap, -find='[^\\x20-\\x7E\\x09\\x0A\\x0D]', -replace=#replacement_text);
/define_tag;

]

Comments

16 Nov 2009,

internal lasso error

I'm getting a strange error message. Even if the page does not attempt to invoke string_zap, I got the message that there was an unknown internal lasso error.

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