csharp convert object to string

Code Example - csharp convert object to string

                
                        Object obj=new Object();
obj="hi";

string str1=Convert.ToString(obj);
string str2=obj.ToString();
string str3= obj as string;
string str4=(string)obj;
                    
                
 

csharp object to json string

                        
                                Newtonsoft.Json.JsonConvert.SerializeObject(new {foo = "bar"})
                            
                        
 

csharp convert ad objectguid to string

                        
                                new Guid((System.Byte[])this.GUID).ToString()