input: Write a python function to find all occurrences of a substring within a given string and return their starting indices.
  assert search("test", "this is a test string with test cases") == [10, 27]
  assert search("is", "this is a test string with test cases") == [2, 5, 22]
  assert search("abc", "abcabcabc") == [0, 3, 6]
  assert search("123", "no numbers here") == []
output: def search(substring, string):
      indices = []
      index = string.find(substring)
      while index != -1:
          indices.append(index)
          index = string.find(substring, index + 1)
      return indices