Home
Manage Your Code
Snippet: Dump Type of Variable and Value (C#)
Title: Dump Type of Variable and Value Language: C#
Description: Puts the type of variable and the contents in the debug stream Views: 160
Author: Nathan Tuttle Date Added: 4/23/2008
Copy Code  
1public String Dump(String Message, params object[] args)
2        {
3            String outMess = "";
4            outMess += Message+"\n";
5            foreach (object obj in args)
6            {
7                outMess += String.Format("{0} -> {1}\n",(obj.GetType()).ToString(),obj);
8            }
9            Debug.WriteLine(outMess);
10            return outMess;
11        }
Usage
Dump(String, any number of variables)