How to remove the spaces in a given string?

Use the Namespace System.Text.RegularExpressions VB.NET Dim strval As String = ‘Jack and Jill’ Dim strnewval As String = Regex.Replace(strval, ‘ ‘, ”) Response.Write(strnewval) C# string strval = ‘Jack and Jill’; string strnewval = Regex.Replace(strval, ‘ ‘, ”); Response.Write(strnewval) ;

How to populate a listbox with the Column Names in a Table

VB.NET ’Populate the dataset Dim dc As DataColumn For Each dc In ds.Tables(0).Columns ListBox1.Items.Add(dc.ColumnName) Next C# //Populate the Dataset foreach (DataColumn dc in ds.Tables[0].Columns) { ListBox1.Items.Add(dc.ColumnName); }