StringExt.cs 835 B

1234567891011121314151617181920212223242526
  1. namespace qdr.app.studiou.orders2printpack.Extensions
  2. {
  3. public static class StringExt
  4. {
  5. public static string ToQuotedString(this string str)
  6. {
  7. if (str == null)
  8. return string.Empty;
  9. return ToDecoratedString(str, "\"");
  10. }
  11. public static string ToDecoratedString(this string str, string leftDecoration, string rightDecoration)
  12. {
  13. if (str == null)
  14. return string.Empty;
  15. return leftDecoration + str + rightDecoration;
  16. }
  17. public static string ToDecoratedString(this string str, string bothDecoration)
  18. {
  19. if (str == null)
  20. return string.Empty;
  21. return ToDecoratedString(str, bothDecoration, bothDecoration);
  22. }
  23. }
  24. }