Posts

Showing posts with the label C#

Why C# is Still a Top Choice for Developers in 2023

Image
C# is a popular programming language that has been around for over two decades. Despite the emergence of new programming languages, C# remains a top choice for developers in 2023. In this blog post, we'll explore why C# is still a popular programming language and the benefits it offers to developers. Versatility: C# is a versatile language that can be used for a wide range of applications, including web, desktop, and mobile development. It's also used for game development, machine learning, and artificial intelligence. This versatility makes C# a valuable skill for developers and makes it easier to transition between different projects. Strong Community: C# has a strong community of developers who contribute to open source projects, create libraries, and share knowledge. This community provides resources and support for developers and helps to keep the language up-to-date with new technologies and best practices. Familiarity: C# is similar to other popular programming languages

Leetcode - 125. Valid Palindrome

Image
 Problem statement: A phrase is a   palindrome   if, after converting all uppercase letters into lowercase letters and removing all non-alphanumeric characters, it reads the same forward and backward. Alphanumeric characters include letters and numbers. Given a string  s , return  true   if it is a  palindrome , or  false  otherwise . Solution: Problem says, First convert all  uppercase letters into lowercase letters. Remove all non-alphanumeric characters. For first part, I will use ToLower() method of string class. this method will convert all the  uppercase letters into lowercase letters. For the second part, I will use Regex Replace method to remove all  non-alphanumeric characters.  public bool IsPalindrome(string s)   {         /*here i am checking if string is null or empty if so then it will be always                                           Palindrome so return true*/                if(string.IsNullOrEmpty(s))                return true;     /*in this statement i am first c

What is IoC Container?

  IoC Container IoC Container is a framework for implementing automatic dependency injection . before I explain IoC Container first lets know what is  dependency injection Dependency Injection It is a design pattern used to implement IoC. It allows the creation of dependent objects outside of a class and provides those objects to a class through different ways.  The Dependency Injection pattern involves three things which are client, service and the injector so, there will be  three  types of classes  involves in this process . Client Class : The client class is a class which depends on the service class. Service Class : The service class is a class that provides service to the client class. Injector Class : The injector class injects the service class object into the client class. The injector class injects dependencies in three ways: through a constructor, or through a property, or through a method. so, there are three types of Dependency Injection which are: Constructor Injection