Click here to Skip to main content
15,949,741 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
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.
Posted
Updated 4-Sep-17 7:24am
Comments
PIEBALDconsult 4-Sep-17 13:23pm    
What makes you think there is one?
You can _compare_ strings by using a CultureInfo, but I don't think strings themselves have CultureInfo.
https://msdn.microsoft.com/en-us/library/cc190529(v=vs.110).aspx
Member 10585568 4-Sep-17 14:48pm    
actually I came across a program of string where I need to use cultureinfo. Find the question below.

Write a C# Sharp program to compare two substrings using different cultures and ignoring the case of the substrings.
PIEBALDconsult 4-Sep-17 14:49pm    
Well, there you go, see the method I posted a link to.
Member 10585568 5-Sep-17 1:29am    
Thanks
CPallini 4-Sep-17 16:04pm    
My virtual 5.

1 solution

You can use it to format values amongst other things, for example in Spanish format:
C#
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
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900