Created
June 5, 2020 15:13
-
-
Save SamKr/73eb3367ef46cc3a0b8c71e1bcaa5a88 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
internal static string GetQuotedValue(string value) | |
{ | |
try | |
{ | |
if (!value.Contains("\"")) return string.Empty; | |
var values = from Match match in Regex.Matches(value, "\"([^\"]*)\"") select match.ToString(); | |
var resultArray = values as string[] ?? values.ToArray(); | |
return !resultArray.Any() ? string.Empty : resultArray.First().Replace("\"", ""); | |
} | |
catch (Exception ex) | |
{ | |
Log.LogException(ex); | |
return string.Empty; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment