Click here to Skip to main content
14,665,550 members
Rate this:
Please Sign up or sign in to vote.
See more:
hiii
could you please tell me the code for convert a string array into a decimal array in c#?
Posted

Rate this:
Please Sign up or sign in to vote.

Solution 1

its based on your Requirement.
check this

String array to decimal array

String array to decimal array
   
v2
Rate this:
Please Sign up or sign in to vote.

Solution 2

decimal[] decimal_array = new decimal[] {1.1M, 1.2M, 1.3M, 1.4M };
string[] string_array = Array.ConvertAll(decimal_array, x => x.ToString());

foreach (var item in string_array)
{
      Console.WriteLine("{0} - {1}", item.GetType(), item);
}
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100