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>atnext() - get <nth> occurrence of a character in a string</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
  Name:     atnext() - get <nth> occurrence of a character in a string
  Usage:    <integer> = atnext(<char>,<string>,<occurrence>)
  Params:   character <char> - the character to search for
            string <string> - the string to search in
            integer <occurrence> - the occurrence of <char> to find
  Returns:  integer equal to the position of <occurrence> of <char>
            within <string>

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

                 ? atnext("i","This is the string",3)
                 * prints 16

                 memvar = "This is the string"
                 pos = atnext("i",memvar,2)
                 end = atlast("i",memvar)
                 ? substr(memvar,pos,(end-pos)+1)

                 * prints "is the stri"


See Also: atlast() chrcount() chrfound() chrswap() stratnext()

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