ASP.NET - how to split the given value - Asked By Svs Suresh on 10-Mar-12 01:46 AM

how to split  1 US Dollar = 3.00937 Malaysian Ringgit this and get 3.00937
D Company replied to Svs Suresh on 10-Mar-12 01:52 AM
Hello Suresh,

I think u can use  Decimal.Parse, Using this you can pass a System.Globalization.NumberStyles to control how strings are parsed. This will let you convert currency strings back to decimals easily. and use your logic to convert dollar to specific currency.


Regards
D
dipa ahuja replied to Svs Suresh on 10-Mar-12 11:27 AM
Simple way:

string s = 1 US Dollar = 3.00937;

 

string[] data = s.Split('=');
string firstname = data[0].ToString();//1 US Dollar
string lastname = data[1].ToString(); //3.00937