Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C#- ToLower() is sometimes removing dot from the letter "I"

Tags:

string

c#

culture

We have noticed a weird error when calling ToLower() on certain strings.

The input string is:

string s = "DocumentInfo"; string t = s.ToLower(); // sometimes, t == documentinfo // other times, t == documentınfo  (note dot is missing from i - INCORRECT) 

We are passing the string to a web service query downstream, so it is causing problems for us.

My initial guess is that it has something to do with Culture or UICulture, as some of our pages customize these settings per user.

Could this be the issue? Is there are way I can force this to work properly?

UPDATE 2011.07.06

I found that I could duplicate the issue by setting Culture to tr-TR. Not sure if other cultures are impacted.

like image 576
frankadelic Avatar asked Jul 06 '11 18:07

frankadelic


People also ask

What C is used for?

C programming language is a machine-independent programming language that is mainly used to create many types of applications and operating systems such as Windows, and other complicated programs such as the Oracle database, Git, Python interpreter, and games and is considered a programming foundation in the process of ...

Is C language easy?

Compared to other languages—like Java, PHP, or C#—C is a relatively simple language to learn for anyone just starting to learn computer programming because of its limited number of keywords.

What is C in C language?

What is C? C is a general-purpose programming language created by Dennis Ritchie at the Bell Laboratories in 1972. It is a very popular language, despite being old. C is strongly associated with UNIX, as it was developed to write the UNIX operating system.

What is C full form?

Full form of C is “COMPILE”. One thing which was missing in C language was further added to C++ that is 'the concept of CLASSES'.


1 Answers

Try using String.ToLowerInvariant().

like image 52
Daniel A. White Avatar answered Oct 05 '22 03:10

Daniel A. White