using Newtonsoft.Json.Linq;
string jsonArrayString = "[\"apple\", \"banana\", \"cherry\"]";
if (string.IsNullOrWhiteSpace(jsonArrayString))
throw new ArgumentException("JSON input cannot be null or empty.");
JArray jsonArray = JArray.Parse(jsonArrayString);
string[] stringArray = jsonArray.ToObject<string[]>();
Console.WriteLine("Converted array:");
foreach (string fruit in stringArray)
Console.WriteLine(fruit);
Console.WriteLine($"JSON parsing error: {ex.Message}");
catch (ArgumentException ex)
Console.WriteLine($"Input validation error: {ex.Message}");
Console.WriteLine($"Unexpected error: {ex.Message}");