String Array
String Arrays are used to store more than one string. We create and declare string arrays like that:
string[] arr1 = new string[] { "one", "two", "three" };
String.Remove method
String.Remove method is used to delete a value which we want to remove from a given string array.
Removal of Specified String in String Array
We can remove a specified string in the string array by using String.remove method.
Code
using System.Collections;
using System.IO;
using System.Text.RegularExpressions;
class Program
{
static void Main(string[] args)
{
String[] array = { "1", "2", "3", "4", "5", "6" };
String hc = InputRemove("4", array);
if (hc.Equals(""))
{
Console.WriteLine("input String has Been Removed");
Console.ReadLine();
}
}
public static String InputRemove(string input, params String[] values)
{
string specified = input;
foreach (string removal in values)
{
int i;
while ((i = specified.IndexOf(removal)) > -1)
{
specified = specified.Remove(i, removal.Length);
}
}
return specified;
}
}
C++ Printed and Ebooks (Buy Now with special discounts)









