Back to Browse

#27 Overriding ToString - C# Tutorials for Beginners | CoffeeNCode

3.1K views
May 9, 2021
7:58

How to override ToString to make better functioning classes in Visual Studio using C#! 🎓C# Ultimate masterclass course with tasks & projects - 73% off! ⬇️ https://csharp.codewithaba.com/udemy 💖 Become a Patron: Show support & get perks! https://www.patreon.com/coffeencode 💻 Community Discord server https://discord.gg/nv3ukXaSvt When you join the server, you can get your own personal help channel for FREE where you can post anything you're stuck with and I will help you 😊 ☕ Buy me a Coffee https://ko-fi.com/coffeencode https://www.buymeacoffee.com/coffeencode Overriding the ToString method can open your code up to different use cases, its stops the use for another function just to print details about a certain class. You can create shorter outputs to the screen by making sure you override ToString which will let you specify your own return like in the video you can display the details about a Person without having to write another function. Theory aside, they are used to make your code a lot smaller and neater to read when you are doing something simple and it can help the readability and maintainability of your code when others or you (in the future) reads it again! 📣 Socials https://twitter.com/CodeWithAba https://www.instagram.com/CodeWithAba Timestamps: 0:00 Intro 0:25 Examples 3:50 ToString refactor 5:45 Recap 7:33 Outro & Patreon shoutout

Download

1 formats

Video Formats

360pmp411.7 MB

Right-click 'Download' and select 'Save Link As' if the file opens in a new tab.

#27 Overriding ToString - C# Tutorials for Beginners | CoffeeNCode | NatokHD