CodePaste Logo
New Snippet New Snippet Recent Snippets Recent Snippets My Snippets My Snippets Web Code Search Snippets Search
Sign inor Register
Language: C#

No Title

147 Views
Copy Code Show/Hide Line Numbers
// Comparing C# to the "Java’s toLowerCase() has got a surprise for you!" article:
// http://javapapers.com/core-java/javas-tolowercase-has-got-a-surprise-for-you/
// ------------------------------------------------------------
// NOTE: C# doesn't seem to exhibit the same issue.
// ------------------------------------------------------------
 
static void Main(string[] args)
{
    // setting Lithuanian as locale 
    System.Threading.Thread.CurrentThread.CurrentUICulture = new CultureInfo("lt");
 
    const string str = "\u00cc";
 
    // Java & C# = Ì 
    Console.WriteLine("Before case conversion is {0} and length is {1}"
        , str, str.Length);
 
    string lowerCaseStr = str.ToLower();
 
    // Java = i?` 
    // C# = ì
    Console.WriteLine("Lower case is {0} and length is {1}"
        , lowerCaseStr, lowerCaseStr.Length);
 
    Console.ReadLine();
    return;
}
by Al Gonzalez
  May 10, 2010 @ 2:18pm

Add a comment


Report Abuse
brought to you by:
West Wind Techologies



If you find this site useful and use it frequently please consider making a donation to support this free service.
Donate