input: Write a function to count the number of times a substring appears in a given string.
  assert countSubstrings("The quick brown fox jumps over the lazy dog.", "the") == 2
  assert countSubstrings("banana", "na") == 2
  assert countSubstrings("aaaa", "aa") == 3
output: def countSubstrings(main_string, sub_string):
      count = 0
      start = 0
      while True:
          start = main_string.find(sub_string, start)
          if start == -1:
              break
          count += 1
          start += 1
      return count