Showing posts with label Convert. Show all posts
Showing posts with label Convert. Show all posts

Friday, 20 March 2015

convert list to string c#

There are many ways you will do convert list to string c# from google. But what you will adopt, which is good in terms of line and in terms of complexity.

 I will demonstrate three ways to convert list to string c# with “,” seperated  and you will see that which one is taking less time in execution.
Suppose you have list of sting, that you can form like below code; Having 1Lakhs of string records


Saturday, 1 November 2014

Converting String to Int in C#

String is the reference type in C# and int is the value type.(What is Ref and Value type )
So, The way of maintain the memory location are quite different for both of them and to converting the value to refrence is called boxing in C#.

If you see the below program;
static void Main(string[] args)
        {
            int i = 123;
            string str = "123";

            if (str.Equals(i))
                Console.WriteLine("Success");
            else
                Console.WriteLine("fails");

        }

Saturday, 22 March 2014

How to Convert array to string ?

Converting the list of array values into form of string, This helps  to show the value into any control or to store many values in a single database field.

How it work?  suppose you have Array like “Xx”, “ Yy” and “ Zz”,  There  you can join and get the value into string like “Xx Yy Zz”.
There is string method to make it simple to join the array and from a single string.