String extension useful for logging


/ Published in: C#
Save to your folder(s)



Copy this code and paste it in your HTML
  1. public static class StringExt
  2. {
  3. public static string AsText(this string source)
  4. {
  5. if (null == source)
  6. return "null";
  7.  
  8. const string doubleQuotes = "\"";
  9. return string.Concat(doubleQuotes, source, doubleQuotes);
  10. }
  11. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.