Posted By

ronklein on 12/29/10


Tagged

String text logging


Versions (?)

String extension useful for logging


 / Published in: C#
 

  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  

You need to login to post a comment.