We can use String.Join method to create a new string from an array of string. Let’ say I have a array of the some words and i want to create a sentence from this array then i can use The String.Join method with an array and a separator string. Continue reading “Create a new string from an array of string through String.Join method”
Tag: Array in C#
In this section you can find various articles and code snippets related to Array in C# language. An array type is a reference type that refers to a space containing one or more elements of a certain type. All array types derive from a common base class, System.Array.
An array is a sequential list of items. The kind of items you can store in the array are defined by the type of the array at declaration. Arrays can be single or multi-dimensional, and each dimension can have varying lengths (jagged).
Simple Example of Array in C#
int[] myIntArray = new int[5] { 1, 2, 3, 4, 5 };
External Links:
Array class on MSDN
Exclude specific files in file search with in a directory in C#
This article demonstrate how we can get the list of the files according specific search pattern with excluding some files. Suppose if a folder contains the following files: Continue reading “Exclude specific files in file search with in a directory in C#”
How to resize multidimensional array in C#?
Today i need to re size a two dimensional array in my project. we know that C# does not contain any statement like Redim or Redim Preserve of the vb.net. So i wrote the following function to re size an two dimensional array in C#. Continue reading “How to resize multidimensional array in C#?”
Search for an element in array with Array.Find method in c#
Array.Find
Continue reading “Search for an element in array with Array.Find method in c#”
How to copy a range of elements from one array to another in c#
If you want to copy a range of the elements from one array to another then we can use Array.ConstrainedCopy Method. In this article i will try to understand that how we can copy a range of elements from one array to another.
Continue reading “How to copy a range of elements from one array to another in c#”
How to merge two or more array in single array in C#
In this article i will describe two methods for merging two array in single array using C#
You can use the System.Collections.Generic.List class and simple Resize and Copy methods of the Array class for doing this.
Continue reading “How to merge two or more array in single array in C#”
How to Convert Arraylist to Array in .net
Array is the group or collection of similar datatypes object and it is member of the system namespace whereas ‘Arraylist’ is the group of variables or object with different datatypes and it implement the ‘IList’ interface using an array whose size is dynamically increased as required.
Continue reading “How to Convert Arraylist to Array in .net”