ToString()

noun

say it: “too-STRING” /tuːˈstrɪŋ/

The method every C# object has that returns text describing it; override it to print something useful.

What does ToString() do in C#?

ToString() — A method that returns a readable text representation of an object.

In a sentence

  • “I overrode ToString so printing a book shows "Dune by Frank Herbert".”

Level: Journeyman · More C# terms at this level

Updated

In other subjects