On Feb 22, 2012, at 9:46 PM, Bob Sneidar wrote:

> only works for single characters. 
> 
> function substringCount pString, pChunk
>  replace pString with cr & pString & cr in pChunk
>  filter pChunk with pString
>  return the number of lines of pChunk
> end substringCount

Here's one that works if you only have 1 character you're searching for:


   split tString by tChar
   put (the number of elements of tString) - 1 into tNumOccurrences


Just offering another way to do it…

:D

Ken Ray
Sons of Thunder Software, Inc.
Email: k...@sonsothunder.com
Web Site: http://www.sonsothunder.com/  

_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to