Menu Close

Blog

Slide 1

Microsoft Business Applications Blogposts, YouTube Videos and Podcasts

Helping Businesses with Technology

Slide 2

Microsoft Business Applications Blogposts, YouTube Videos and Podcasts

Helping Businesses with Technology

Slide 3

Microsoft Business Applications Blogposts, YouTube Videos and Podcasts

Helping Businesses with Technology

previous arrow
next arrow

WHAT ARE PARTIAL CLASSES

WHAT ARE PARTIAL CLASSES

what are partial classes?
what are the advantages or uses of partial classes?
where are partail classes used?
Partial classes allows us to split class into 2 or more files. All these parts are then combined into a single class, when the application is compiled. the partial keyword can also be used to split a struct or an interface over two or more files.

Share this:

DIFFERENCE BETWEEN SYSTEM.STRING AND SYSTEM.TEXT.STRINGBUILDER

DIFFERENCE BETWEEN SYSTEM.STRING AND SYSTEM.TEXT.STRINGBUILDER

System.String is immutable  |||      StringBuilder is Mutable

As StringBuilder objects are mutable, they offer better performance than string objects of type
System.String, when heavy string manipulation is involved.
EXAMPLE OF SYSTEM.STRING  I.E STRING() METHOD
Stack       and       Heap
string                   c#
                            vidoe
                             tutorial
                             for
                             beginners


EXAMPLE  OF SYSTEM.TEXT.STRINGBUILDER
Stack       and       Heap
string                   c# video tutorial for beginners


using System;
using System.Text;
namespace ConsoleApplication4
{
    public class MainClass
    {
        public static void Main()
        {
            string userString = string.Empty;
            for(int i = 1; i <= 10000;i++ )
            {
                userString += i.ToString() + ” “;
                
            }
            Console.WriteLine(userString);
            Console.ReadLine();
            
            // using system.string  
            //string userstring = “C#”;
            //userstring += “Vidoe”;
            //userstring += “Tutorail”;
            //userstring += “for”;
            //userstring += “Beginners”;
            //Console.WriteLine(userString);
            //Console.ReadLine();
            //// using system.text.stringbuilder
            //StringBuilder userString = new StringBuilder(“C#”);
            //userString.Append(” Video”);
            //userString.Append(” Tutorial”);
            //userString.Append(” For”);
            //userString.Append(” Beginners”);
            //Console.WriteLine(userString.ToString());
            //Console.ReadLine();
        }
    }
}
   


Share this:

DIFFERENCE BETWEEN CONVERT.TOSTRING() AND TOSTRING()

DIFFERENCE BETWEEN CONVERT.TOSTRING() AND TOSTRING()

Convert.Tostring() handles null, while ToString() doesn’t  and throws a NULL
Reference exception.

Depending on the type of the application architecture and what you are trying to achieve , 
you choose one over the other.

using System;
namespace ConsoleApplication4
{
    public class MainClass
    {
        public static void Main()
        {
            Customer C1 = null;
            string str = Convert.ToString(C1);
            Console.WriteLine(str);
            Console.ReadLine();
        }
    }
    public class Customer
    {
        public string Name { get; set; }
      
      
    }
}
   

Share this: