Changeset 163 for trunk/SRC/Textoidl/strcnt.pro
- Timestamp:
- 08/29/06 14:59:46 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SRC/Textoidl/strcnt.pro
r134 r163 1 ;+ 2 ; @file_comments 3 ; Count number of occurrences of a substring in a string. 1 4 ; 2 ;+ 3 ; NAME: 4 ; STRCNT 5 ; PURPOSE: 6 ; Count number of occurrences of a substring in a string. 7 ; CATEGORY: 8 ; text/strings 9 ; CALLING SEQUENCE: 10 ; num = strcnt(strn, substring, [pos]) 11 ; INPUTS: 12 ; string -- The string in which to count occurences. in 13 ; substring -- The substring to count occurrences of. in 14 ; pos -- the position at which to begin the search. [in] 15 ; If not supplied, start at beginning of 16 ; string. 17 ; KEYWORD PARAMETERS: 18 ; /HELP -- Print useful message and return. 19 ; OUTPUTS: 20 ; num -- Number of occurances of substring in string. out 21 ; COMMON BLOCKS: 22 ; SIDE EFFECTS: 23 ; NOTES: 24 ; Overlapping occurances are not counted separately. For 25 ; example, counting occurances of 'bb' in 'blah bbb' returns one 26 ; occurance. 27 ; EXAMPLE: 28 ; MODIFICATION HISTORY: 29 ; $Id: strcnt.pro,v 1.3 1996/06/14 20:00:27 mcraig Exp $ 5 ; @categories 6 ; Text, String 7 ; 8 ; @param STRN {in}{required}{type=string} 9 ; The string in which to count occurences. 10 ; 11 ; @param SUBSTRN {in}{required}{type=string} 12 ; The substring to count occurrences of. 13 ; 14 ; @param STARTPOS {in}{required} 15 ; The position at which to begin the search. 16 ; If not supplied, start at beginning of string. 17 ; 18 ; @keyword HELP 19 ; Print useful message and return. 20 ; 21 ; @returns 22 ; Number of occurances of substring in string. 23 ; 24 ; @restrictions 25 ; Overlapping occurances are not counted separately. For 26 ; example, counting occurances of 'bb' in 'blah bbb' returns one 27 ; occurance. 28 ; 29 ; @history 30 30 ; $Log: strcnt.pro,v $ 31 31 ; Revision 1.3 1996/06/14 20:00:27 mcraig … … 39 39 ; Initial revision 40 40 ; 41 ; RELEASE:42 ; $Name: Rel_2_1_2 $43 ;44 ; COPYRIGHT:45 41 ; Copyright (C) 1996 The Regents of the University of California, All 46 42 ; Rights Reserved. Written by Matthew W. Craig. 47 43 ; See the file COPYRIGHT for restrictions on distrubting this code. 48 44 ; This code comes with absolutely NO warranty; see DISCLAIMER for details. 45 ; 46 ; @version 47 ; $Id$ 49 48 ;- 50 FUNCTION Strcnt, strn, substrn, startpos, $49 FUNCTION strcnt, strn, substrn, startpos, $ 51 50 HELP=Help 52 51 ;
Note: See TracChangeset
for help on using the changeset viewer.