Skip to content

Instantly share code, notes, and snippets.

@FilipDeVos
Created July 30, 2012 11:19
Show Gist options
  • Save FilipDeVos/3206291 to your computer and use it in GitHub Desktop.
Save FilipDeVos/3206291 to your computer and use it in GitHub Desktop.
ADP.BuildQuotedString
internal static string BuildQuotedString(string quotePrefix, string quoteSuffix, string unQuotedString)
{
StringBuilder builder = new StringBuilder();
if (!IsEmpty(quotePrefix))
{
builder.Append(quotePrefix);
}
if (!IsEmpty(quoteSuffix))
{
builder.Append(unQuotedString.Replace(quoteSuffix, quoteSuffix + quoteSuffix));
builder.Append(quoteSuffix);
}
else
{
builder.Append(unQuotedString);
}
return builder.ToString();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment