Return to Snippet

Revision: 13730
at May 4, 2009 09:39 by mtelligent


Initial Code
public string SerializeToString<T>(T obj)
{
      StringWriter sw = new StringWriter();

      XmlSerializer serializer = new XmlSerializer(typeof(T));
      serializer.Serialize(sw, obj);

      return sw.ToString();
}

Initial URL

                                

Initial Description

                                

Initial Title
Serialize Object To String

Initial Tags

                                

Initial Language
C#