input: Write a python function to convert a list of dictionaries to a JSON string with indentation.
  assert convert_to_json([{"id": 5, "name": "John"}, {"id": 7, "name": "Jack"}, {"id": 9, "name": "James"}]) == '[\n    {\n        "id": 5,\n        "name": "John"\n    },\n    {\n        "id": 7,\n        "name": "Jack"\n    },\n    {\n        "id": 9,\n        "name": "James"\n    }\n]'
  assert convert_to_json([{"id": 1, "name": "Alice"}, {"id": 2, "name": "Bob"}]) == '[\n    {\n        "id": 1,\n        "name": "Alice"\n    },\n    {\n        "id": 2,\n        "name": "Bob"\n    }\n]'
  assert convert_to_json([{"id": 3, "name": "Charlie"}]) == '[\n    {\n        "id": 3,\n        "name": "Charlie"\n    }\n]'
output: import json
  
  def convert_to_json(list_of_dicts):
      return json.dumps(list_of_dicts, indent=4)