Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- FUNCky - <b>name:</b> <b>chrcount() - find number of times a char occurs in string</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
  Name:     chrcount() - find number of times a char occurs in string
  Usage:    <integer> = chrcount(<char>,<string>)
  Params:   character <char> - the character to search for
            string <string> - the string to search
  Returns:  integer equal to the number of times <char> occurs
            in <string>

 ---------------------------------- Example ---------------------------------

                 ? chrcount("A","ABCABCABCDE")
                 * prints 3

                 memvar = "Text,is,delimited,with,commas"
                 count = chrcount(",", memvar)+1
                 declare MYarray[count]
                 for x = 1 to count
                      MYarray[x] = strextract(memvar,",",x)
                 next

See Also: chrfound() strextract() chrswap() strcount()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson