什么是C#中的字符串的cultureinfo? [英] What is cultureinfo of a string in C#?

查看:573
本文介绍了什么是C#中的字符串的cultureinfo?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是C#中的字符串的CultureInfo?

我尝试过的事情:

我在google中搜索,它提供了许多与字符串的cultureinfo相关的博客,但我听不懂.

What is cultureinfo of a string in c#?

What I have tried:

I searched in google it gives many blog related to cultureinfo of a string but I couldn''t understand. it will be helpful for me if anyone share an idea about it.

推荐答案

您可以使用它来设置值的格式,例如西班牙语格式:
You can use it to format values amongst other things, for example in Spanish format:
doubleNumber = -1898300.1987;
	Console.WriteLine(doubleNumber.ToString("F1", CultureInfo.InvariantCulture));  
	// Displays -1898300.2

	Console.WriteLine(doubleNumber.ToString("F3", CultureInfo.CreateSpecificCulture("es-ES")));
	// Displays -1898300,199


这篇关于什么是C#中的字符串的cultureinfo?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆