i am converting strings to values using a culture specified to me as a IFormatProvider
.
i am trying to figure out which culture they gave me.
i realize that IFormatProvider
doesn't necessarily have to correspond to a System.Globalization.Culture
, but it did.
So how can i get its name?
The CultureInfo
class implements IFormatProvider
so you may try casting:
IFormatProvider provider = ...
CultureInfo ci = provider as CultureInfo;
if (ci != null)
{
string name = ci.DisplayName;
...
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.