Please try the below....this will work...
static void Main(string[] args)
{
List<string> listBinary = new List<string>();
listBinary.Add("101");
listBinary.Add("111");
listBinary.Add("110");
listBinary.Add("1111");
List<string> listDecimal = new List<string>();
foreach (var str in listBinary)
{
listDecimal.Add(ConvertBinaryToDecimal(str));
}
foreach (var str in listDecimal)
{
Console.WriteLine(str);
}
}
private static string ConvertBinaryToDecimal(string a)
{
double str = 0;
char[] arr = a.ToCharArray();
int i = arr.Length - 1;
foreach (char c in arr)
{
str = str + Math.Pow(2, i)*Convert.ToDouble(c.ToString());
i--;
}
return str.ToString();
}