C# Programming For Beginners - Lecture 3: Lists, Arrays, Index Logic, DateTime, Math Methods, Format
SECourses
C# Programming For Beginners Lectures (3/14) will teach you #CSharp #programming from 0 to beginner / intermediate level. So if you have no idea about programming, if you don't know anything about #coding, or if you want to become a Software Engineer, please subscribe and follow our courses.
Discord ➡️ https://bit.ly/SECoursesDiscord Patreon ➡️ https://www.patreon.com/SECourses
Technology Playlist (30+ Tutorial / Guide / News / Review Videos) ⤵️ https://www.youtube.com/playlist?list=PL_pbwdIyffsnkay6X91BWb9rrfLATUMr3
Stable Diffusion Playlist (30+ Tutorial / Guide Videos) ⤵️ https://www.youtube.com/playlist?list=PL_pbwdIyffsmclLl0O144nQRnezKlNdx3
Please join discord, mention me and ask me any questions. Thank you for like, subscribe, share and Patreon support. I am open to private consulting with Patreon subscription.
Full playlist of this course ⤵️ https://www.youtube.com/playlist?list=PL_pbwdIyffskoSXySh0MdiayPJsBZ7m2o
You can watch for free our C# Programming, ASP .NET Core MVC programming, Machine Learning and Software Engineering related courses on our playlists page ⤵️ https://www.youtube.com/@SECourses/playlists
GitHub code repository of this course (source codes of the lectures) ⤵️ https://github.com/FurkanGozukara/CSE105-2020-introduction-to-programming
Lecture 3/14:
- String Format, DatetTime, Format DateTime, DateTime.Add method
- How to debug line by line, step over, step into
- List Class, Index logic of arrays, lists, etc. in C#
- String Concatenation, String Manipulation
- Math.Round, Math.Floor, Numerics manipulation
- System Culture and System Culture Format and conversion affect
- How to use the If method
- Convert.To method usage
Topic 1: String Format, DateTime, Format DateTime, DateTime.Add method
Working with strings and dates is an essential part of programming, especially when it comes to C#. This language provides a set of tools that make it easier to format, manipulate and work with both strings and dates. In this article, we'll take a look at string format, DateTime, format DateTime and DateTime.Add method in C#.
String Format The string format method allows you to format strings in a specific way. This method replaces the format items in a specified string with the string representations of corresponding objects. For example, you can use string format to format a date string in a specific way.
Here's an example:
csharp Copy code DateTime date = DateTime.Now; string formattedDate = string.Format("Today is {0:dd/MM/yyyy}", date); In this example, we are formatting the date string in the "dd/MM/yyyy" format. The "dd" is the day, "MM" is the month and "yyyy" is the year.
DateTime DateTime is a class in C# that represents a date and time. You can use this class to create, manipulate and format dates and times. Here's an example:
csharp Copy code DateTime date = DateTime.Now; This creates a new instance of the DateTime class with the current date and time.
Format DateTime DateTime provides a method to format dates and times using different formats. Here's an example:
csharp Copy code DateTime date = DateTime.Now; string formattedDate = date.ToString("dd/MM/yyyy"); In this example, we are formatting the date string in the "dd/MM/yyyy" format. The "dd" is the day, "MM" is the month and "yyyy" is the year.
DateTime.Add method The DateTime.Add method allows you to add a specified time interval to a DateTime object. Here's an example:
csharp Copy code DateTime date = DateTime.Now; DateTime newDate = date.AddHours(2); In this example, we are adding 2 hours to the current date and time.
Topic 2: How to debug line by line, step over, step into
Debugging is an essential part of programming. It helps you identify and fix errors in your code. In C#, you can use the Visual Studio debugger to debug your code. In this article, we'll take a look at how to debug line by line, step over, step into in C#.
Line by Line Debugging Line by line debugging allows you to step through your code one line at a time. To do this, you can set a breakpoint at the start of the code you want to debug. Once you start debugging, the debugger will stop at the breakpoint, and you can use the "Step Over" and "Step Into" buttons to step through the code.
Step Over The "Step Over" button allows you to execute the current line of code and move to the next line. If the current line contains a method call, the method will be executed, and the result will be returned to the caller. The debugger will not stop in the method.
Step Into The "Step Into" button allows you to step into a method call. If the current line contains a method call, the debugger will stop in the method, allowing you to step through the method code line by line.
Topic 3: List Class, Index logic of arrays, lists, etc. in C#
Arrays and lists are essential data structures in programming. They allow you to store a collection of items in memory. In C#, the List class provides an implementation. ... https://www.youtube.com/watch?v=Z90GNhnt6A0
423489900 Bytes