Link | lp_string_wordcount |
Author | Bil Corry |
Category | String |
Version | 8.x |
License | Public Domain |
Posted | 08 May 2006 |
Updated | 08 May 2006 |
More by this author... |
Returns the number of words in a given string of text.
Requires [lp_string_extendedtoplain]
var:'text' = "This is a test in the U.S.A. at 3:00pm with US$1,125.34 (EU$1.125,34). It's great fun at O'Hare. Hale-Bopp was an interest- ing comet. héllo wörld!?!?"; 'Text = ' $text ''; lp_string_wordcount: $text; // returns 24
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_wordcount', -description='Returns the number of words in a given string of text.', -priority='replace', -required='string'; // ideas from this thread: // http://www.listsearch.com/lassotalk.lasso?id=163162 return: (string_findregexp: (lp_string_extendedtoplain: (string: $text)), -find='\\w+\\-\\s+\\w+|[\\w\\-\':,\\.\\$]*\\w+[\\w\\-\':,\\.\\$]*')->size; /define_tag; ]
No comments
©LassoSoft Inc 2015 | Web Development by Treefrog Inc | Privacy | Legal terms and Shipping | Contact LassoSoft