Skip to content
This repository was archived by the owner on Dec 24, 2022. It is now read-only.

Commit 4b0f937

Browse files
committed
StripQuotes also strips single quotes
1 parent 721a78a commit 4b0f937

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/ServiceStack.Text/StringExtensions.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -697,7 +697,8 @@ public static string StripQuotes(this string text)
697697
{
698698
return string.IsNullOrEmpty(text) || text.Length < 2
699699
? text
700-
: text[0] == '"' && text[text.Length - 1] == '"'
700+
: (text[0] == '"' && text[text.Length - 1] == '"') ||
701+
(text[0] == '\'' && text[text.Length - 1] == '\'')
701702
? text.Substring(1, text.Length - 2)
702703
: text;
703704
}

0 commit comments

Comments
 (0)