AmitDiwan has Published 10744 Articles

How to copy the entire ArrayList to a one-dimensional Array in C# ?

AmitDiwan

AmitDiwan

Updated on 10-Dec-2019 10:56:17

211 Views

To copy the entire ArrayList to a one-dimensional array, the code is as follows −Example Live Demousing System; using System.Collections; public class Demo {    public static void Main(){       ArrayList list = new ArrayList();       list.Add("AB");       list.Add("BC");       list.Add("CD");     ... Read More

How to copy a String into another String in C#

AmitDiwan

AmitDiwan

Updated on 10-Dec-2019 10:52:48

476 Views

To copy a String into another String, the code is as follows −Example Live Demousing System; public class Demo {    static public void Main(){       string str1 = "Kevin";       string str2 = String.Copy(str1);       Console.WriteLine("String1 = "+str1);       Console.WriteLine("String2 = "+str2); ... Read More

How to check whether a List contains a specified element in C#

AmitDiwan

AmitDiwan

Updated on 10-Dec-2019 10:48:25

599 Views

To check whether a List contains a specified element, the code is as follows −Example Live Demousing System; using System.Collections.Generic; public class Demo {    public static void Main(String[] args){       List list1 = new List();       list1.Add("One");       list1.Add("Two");       list1.Add("Three");   ... Read More

Copying the Collection elements to an array in C#

AmitDiwan

AmitDiwan

Updated on 10-Dec-2019 10:45:09

114 Views

To copy the Collection elements to an array, the code is as follows −Example Live Demousing System; using System.Collections.ObjectModel; public class Demo {    public static void Main(){       Collection col = new Collection();       col.Add("One");       col.Add("Two");       col.Add("Three");       ... Read More

Copying BitArray elements to an Array in C#

AmitDiwan

AmitDiwan

Updated on 10-Dec-2019 10:41:10

256 Views

To copy BitArray elements to an Array, the code is as follows −Example Live Demousing System; using System.Collections; public class Demo {    public static void Main(){       BitArray arr = new BitArray(2);       arr[0] = false;       arr[1] = true;       Console.WriteLine("Elements ... Read More

Copy the Stack to an Array in C#

AmitDiwan

AmitDiwan

Updated on 10-Dec-2019 10:35:19

194 Views

To copy the stack to an array, the code is as follows −Example Live Demousing System; using System.Collections.Generic; public class Demo {    public static void Main(){       Stack stack = new Stack();       stack.Push(10);       stack.Push(20);       stack.Push(30);       stack.Push(40); ... Read More

Copy the entire LinkedList to Array in C#

AmitDiwan

AmitDiwan

Updated on 10-Dec-2019 10:31:13

371 Views

To copy the entire LinkedList to Array, the code is as follows −Example Live Demousing System; using System.Collections.Generic; public class Demo {    public static void Main(){       LinkedList list = new LinkedList();       list.AddLast(100);       list.AddLast(200);       list.AddLast(300);       int[] ... Read More

Copy the elements of collection over a range of elements in ArrayList in C#

AmitDiwan

AmitDiwan

Updated on 10-Dec-2019 10:28:47

275 Views

To copy the elements of the collection over a range of elements in ArrayList, the code is as follows −Example Live Demousing System; using System.Collections; public class Demo {    public static void Main(){       ArrayList arrList = new ArrayList();       arrList.Add("A");       arrList.Add("B");   ... Read More

Copy StringDictionary to Array at the specified index in C#

AmitDiwan

AmitDiwan

Updated on 10-Dec-2019 10:26:27

127 Views

To copy StringDictionary to Array at the specified index, the code is as follows −Example Live Demousing System; using System.Collections; using System.Collections.Specialized; public class Demo {    public static void Main(){       StringDictionary strDict = new StringDictionary();       strDict.Add("1", "SUV");       strDict.Add("2", "AUV");     ... Read More

Copy StringCollection at the specified index of array in C#

AmitDiwan

AmitDiwan

Updated on 10-Dec-2019 10:20:29

122 Views

To copy StringCollection at the specified index of the array, the code is as follows −Example Live Demousing System; using System.Collections.Specialized; public class Demo {    public static void Main(){       StringCollection strCol = new StringCollection();       String[] strArr = new String[] { "Tim", "Tom", "Sam", "Mark", ... Read More

Advertisements