.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Ava Aiden
Imran Ghani
Thomas Shaw

Home >> Interview Question >> C# >> Post New Question Subscribe to Interview Questions

how would you remove the blank entry from array in C#.Net?

Posted By :Narayanan     Posted Date :January 03, 2012    Points :40   Category :C# 
Use "StringSplitOptions.RemoveEmptyEntries" in the Array string
like this:
String[] tolist = test.Split(new []{',', ' ', ';'}, StringSplitOptions.RemoveEmptyEntries);

You can also find related Interview Question to how would you remove the blank entry from array in C#.Net?  below: 

What is the difference between ARRAY and STACK?

STACK follows LIFO. Thus the item that is first entered would be the last removed.

In array the items can be entered or removed in any order. Basically each member access is done using index. No strict order is to be followed here to remove a particular element. (More...)

Why do we Use a Multidimensional Array?

A multidimensional array can be useful to organize subgroups of data within an array. In addition to organizing data stored in elements of an array, a multidimensional array can store memory addresses of data in a pointer array and an array of pointers.

Multidimensional arrays are used to store information in a matrix form.
e.g. a railway timetable, schedule cannot be stored as a single dimensional array.
One can use a 3-D array for storing height, width and length of each room on each floor of a building. (More...)

How to add and remove an assembly from GAC?

There are two ways to install .NET assembly in GAC:-
. Using Microsoft Installer Package. You can get download of installer from http://www.microsoft.com.
. Using Gacutil. Goto "Visual Studio Command Prompt" and type "gacutil -i (assembly_name)", where (assembly_name) is the DLL name of the project. (More...)

How to remove a Session variable?

using HttpSessionState.Remove(); (More...)

What's the difference between the System.Array.CopyTo() and System.Array.Clone() in c#?

The first one performs a deep copy of the array, the second one is shallow. (More...)

if we remove a web.config file from the application , is this application will work?

It Depends on coding if we used something that is required to pioc values from configuration file then its required otherwise we can run our application without web.config. (More...)

What Are the Generic Methods of System.Array?

The System.Array type is extended with many generic static methods. The generic static methods are designed to automate and streamline common tasks of working with arrays, such as iterating over the array and performing an action on each element, scanning the array looking for a value that matches a certain criteria (a predicate), converting and sorting the array, and so on. Below is a partial listing of these static methods (More...)

How can you sort the value of the array in descending order?

First call Sort() and then Reverse() methods. (More...)

What's the difference between the System.Array.CopyTo() and System.Array.Clone()?

The Clone() method returns a new array (a shallow copy) object containing all the elements in the original array. The CopyTo() method copies the elements into another existing array. Both perform a shallow copy. A shallow copy means the contents (each array element) contains references to the same object as the elements in the original array. A deep copy (which neither of these methods performs) would create a new instance of each element's object, resulting in a different, yet identacle object. (More...)

How do you declare 2 dimensional array in Javascript?

myarray[0][0]="Compaq 486"
myarray[0][1]="Compaq 586"
myarray[0][2]="Compaq 686"
myarray[1][0]="Dell 486"
myarray[1][1]="Dell 586"
myarray[1][2]="Dell 686"
myarray[2][0]="IBM 486"
myarray[2][1]="IBM 586"
myarray[2][2]="IBM 686" (More...)

How do you initialize a two-dimensional array that you don't know the dimensions of?

int [ , ] myArray; //declaration
myArray = new int [5, 8]; //actual initialization (More...)

Can you store multiple data types in System.Array?

No, If the System.Array is of Some Particular Data Type.(Primitive Data Type)

yes, If the System.Array is of Object Type.

Ex :

create an array of objects.

int in = 50;
string st = "Fifty";

object [] obj = new object[2];
obj[0] = in;
obj[1] = st; (More...)

Quick Links For Interview Questions Categories:
ASP.Net Windows Application   .NET Framework   C#   VB.Net   ADO.Net  
Sql Server   SharePoint   Silverlight   OOPs   JQuery   JavaScript/VBScript
Biztalk Patten/Practices .IIS WCF WPF WWF
Networking Aptitude Others   All      

Find questions, FAQ's and their answers related to .NET, C#, Vb.Net, Sql Server and many more.

Now you can find lots of .NET, C#, Vb.Net, SQL Server,Windows, ASP.Net related Questions and their Answers here at www.dotnetspark.com. Our aim is to help you pass your certification Exams (MCP, MCSD, MCAD etc.,) with flying scores and get good name in your company.

So, Start looking our Interview Question section daily and improve your .NET Skills. You can also help others by posting Interview Questions and their Answers in this section.

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend