input: Write a python function to search for all occurrences of a substring within a string and return their starting indices.
  assert search_substring('This is a test string', 'test') == [10]
  assert search_substring('abababab', 'ab') == [0, 2, 4, 6]
  assert search_substring('hello world', 'o') == [4, 7]
  assert search_substring('aaaaaa', 'aa') == [0, 1, 2, 3, 4]
  assert search_substring('mississippi', 'iss') == [1, 4]
output: def search_substring(main_string, sub_string):
      indices = []
      start = 0
      while True:
          start = main_string.find(sub_string, start)
          if start == -1:
              break
          indices.append(start)
          start += 1  # move past the current match
      return indices