Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

c# print all property values of object

public static string PropertyList(this object obj)
{
  var props = obj.GetType().GetProperties();
  var sb = new StringBuilder();
  foreach (var p in props)
  {
    sb.AppendLine(p.Name + ": " + p.GetValue(obj, null));
  }
  return sb.ToString();
}
Comment

PREVIOUS NEXT
Code Example
Csharp :: c# long to int 
Csharp :: c# replace string case insensitive 
Csharp :: c# read file into a string 
Csharp :: c# reverse string 
Csharp :: how to access gameobject name 
Csharp :: how to get random numbers in c# 
Csharp :: c# ipaddress from localhost 
Csharp :: remove a specific line in richtextbox c# 
Csharp :: how to populate listbox using list<t c# 
Csharp :: headless chromedriver C# 
Csharp :: unity empty action 
Csharp :: get values from range entity framework 
Csharp :: custom editor unity 
Csharp :: unity get scene index 
Csharp :: get apps execution path with app name c# 
Csharp :: unity c# timer 
Csharp :: c# create datatable 
Csharp :: hide game obj oncollisionenter 
Csharp :: unity destroy object on collision 
Csharp :: tooltip button winform 
Csharp :: c# check if string is directory 
Csharp :: unity cinemachine lock camera axis 
Csharp :: How do I remove all non alphanumeric characters from a string? 
Csharp :: gravity script unity 
Csharp :: unity bullet script 
Csharp :: unity get textmesh pro component 
Csharp :: wpf yes no message box exit 
Csharp :: assign long value c# 
Csharp :: c# console play sound 
Csharp :: Specified key was too long; max key length is 1000 bytes (SQL: alter table `permissions` add unique `permissions name guard_name_unique`(`name`, `guard_name`)) 
ADD CONTENT
Topic
Content
Source link
Name
5+8 =