Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- GT_LIB v1.0 Reference Guide Release 1.0 - <b>find number of times a set of characters appears in a string</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 Find number of times a set of characters appears in a string
------------------------------------------------------------------------------

 Syntax

        GT_ChrTotal(<cChrs>, <cStr>) --> nTotOcc

 Arguments:

      <cChrs> - The set of characters
      <cStr>  - The string to search

 Returns:

      nTotOcc - The number of times the characters specified in
                <cChrs> appears in <cStr>

 Description:

      Returns the numnber of occurrences of characters belonging
      to the set <cChrs> in the string <cStr>.  If no characters
      in <cChrs> appears in <cStr> GT_ChrTotal() will return 0.

      NOTE:
         invalid parameters will return -1

 Examples:


       local cStr1 := "the cat sat on the mat"

       ? GT_ChrTotal("tae", cStr1)            // prints 10
       ? GT_ChrTotal("zqw", cStr1)            // prints  0

 Source: CHRTOTAL.C

 Author:  Andy M Leighton

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