Table of contents
TOC
Collapse the table of content
Expand the table of content

Comparer.FromCulture

Owen Duncan|Last Updated: 4/19/2018

About

Returns a comparer function given the culture and a logical value for case sensitivity for the comparison. The default value for ignoreCase is false. The value for culture are well known text representations of locales used in the .NET framework.

Comparer.FromCulture(culture as text, optional ignoreCase as nullable logical) as function  

Arguments

ArgumentDescription
cultureA text value corresponding to the culture values supported on your version of Windows, such as "en-US". If the culture is not specified, the current user culture is used. For a list of culture names, see National Language Support (NLS) API Reference.
optional ignoreCaseLogical value whether or not to ignore the case.

Example

let  
comparer1 = Comparer.FromCulture("en-us", false),  
comparer2 = Comparer.FromCulture("en-us", true)      
in       
[         
Test1 =  comparer1("a","A"), equals  -1   
Test2 =  comparer2("a","A") equals  0    
]  
© 2018 Microsoft