
foreach (DataRow row in dataTable.Rows)
{
foreach (DataColumn column in dataTable.Columns)
{
// Get the cell value as a string
string cellValue = row[column].ToString();
// Check if the value is in the format "{ 'Value': some_value }"
if (cellValue.StartsWith("{") && cellValue.Contains(":") && cellValue.EndsWith("}"))
{
// Extract the value inside the wrapping
int startIndex = cellValue.IndexOf(":") + 1;
int endIndex = cellValue.LastIndexOf("}");
string extractedValue = cellValue.Substring(startIndex, endIndex - startIndex).Trim();
// Remove any remaining quotes
extractedValue = extractedValue.Trim('\'', '"', ' ');
// Update the cell with the extracted value
row[column] = extractedValue;
}
}
}