4
Answers

How to convert array values to class objects in c#?

Hi,
I have a string value with comma separator,
string currency = "EUR:100;INR:500;CZK:500";
var _currency= currency.split(':');
now i get value in array like
EUR:100
INR:500
CZK:500 in _currency variable.
now how to push this array values to my class
class CurrencyValue
{
public string Currency {get;set;}
public int Amount{get;set;}
}
that is EUR to Currency and 100 to Amount?
Answers (4)