Link | pk_removeextension |
Author | Pier Kuipers |
Category | String |
Version | 6.x |
License | Public Domain |
Posted | 05 Jul 2006 |
Updated | 05 Jul 2006 |
More by this author... |
This tag removes the last occurrence of a period followed by any number of characters from the end of a string. Used to isolate a filename from its extension.
pk_removeextension('this is my filename.jpg') -> 'this is my filename' pk_removeextension('this.is.my.filename.jpg') -> 'this.is.my.filename' pk_removeextension('this is my filename') -> 'this is my filename'
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.
if: !(lasso_tagexists: 'pk_removeextension'); define_tag:'removeextension', -namespace='pk_', -required='filename', -description='removes the last occurrence of a period followed by any number of characters from the end of a string'; local('output')=string; if(local_defined('filename')); local:'tempArray' = #filename -> split:'.'; if((#tempArray -> size) > 1); #tempArray -> remove; /if; #output = (#tempArray -> join:'.'); /if; return(#output); /define_tag; /if;
No comments
©LassoSoft Inc 2015 | Web Development by Treefrog Inc | Privacy | Legal terms and Shipping | Contact LassoSoft