Convert string [] to decimal [], int [], float [] .double [] in C #
You cannot convert the string [] directly to decimal [], as it is - all elements must be individually converted to a new type. You can use Array.ConvertAll instead
string[] txt1 = new string[]{"12","13"};
decimal[] dec1 = Array.ConvertAll<string, decimal>(txt1, Convert.ToDecimal);
Similarly, using Convert.ToInt32, Convert.ToSingle, Convert.ToDoublefor the argument Converter<TInput,TOutput>for creating int [], float [], double [], by substituting the correct type arguments ConvertAll
EDIT: Silverlight, ConvertAll, :
decimal[] dec1 = new decimal[txt1.Length];
for (int i=0; i<txt1.Length; i++) {
dec1[i] = Convert.ToDecimal(txt1[i]);
}