Wiki

Changes between Version 20 and Version 21 of StandardLibraryExtensionMethods

Show
Ignore:
Timestamp:
09/23/12 05:00:57 (12 years ago)
Author:
Charles
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • StandardLibraryExtensionMethods

    v20 v21  
    8080                assert 'X'.count(c'x')==0  # case sensitive 
    8181                assert ' ! ! '.count(c'!')==2 
     82 
     83                def count(substring as String) as int 
     84                        """ Return a count of the number of occurrences of the substring in this string. """ 
     85                        test 
     86                                assert ''.count('aoeu') == 0 
     87                                assert 'x'.count('x') == 1 
     88                                assert 'xyxy'.count('xy') == 2 
     89                                assert 'xyxy'.count('a') == 0 
    8290 
    8391        def isCapitalized as bool