I have a string DisplayName which has value as "Vinny' Direct Reports". I am trying to replace "'"with "-"in string as it failing to get ingested into my Data Source.
Below is the code where I am trying to replace.
if (DisplayName.Contains("'", StringComparison.OrdinalIgnoreCase) == true)
{
DisplayName.Replace("'", "-").Replace("\"", "-");
Console.WriteLine(DisplayName);
}