case-insensitive

javascript unique string array case insensitive but keep one case sensitive result

风流意气都作罢 提交于 2020-01-25 07:49:07
问题 What do I mean with this? First let's look at some code I wrote: let names = ['James', 'james', 'bob', 'JaMeS', 'Bob']; let uNames = {}; names.forEach(n => { let lower = n.toLowerCase(); if (!uNames[lower]) { uNames[lower] = n; } }); names = Object.values(uNames); console.log(names); // >>> (2) ["James", "bob"] The goal here is to unique the given array case insensitive but keep one of the original inputs. I was wondering if there is a more elegant/better performing solution to this problem

How do i make Xpath 1.0 query case insensitive

无人久伴 提交于 2020-01-17 11:15:47
问题 In PHP, I'm currently making a xpath query but I need to make it case insensitive. I'm using is XPath 1.0 which from my query means I've got to use some thing called a translate function but I'm unsure of how to do this. Here is my query test PHP file : $html = <<<'HTML' <html> <head> <meta http-equiv="Content-type" content="text/html; charset=utf-8"> <meta NAME="Description" content="Test Case"> <META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW"> <Link Rel="Canonical" href="http://www.testsite

How to do case insensitive string comparison in Nunjucks

送分小仙女□ 提交于 2020-01-16 08:46:08
问题 I'm trying to do a case insensitive match inside of an {% if %} statement The following two approaches do not work: {% set role = 'APP' %} {% if 'app' == role %} 1 {% endif %} {% if 'app' in role %} 2 {% endif %} Nunucks only has a little documentation on their comparison operators, but don't refer to specific types. Nunjucks is a port of Jinja2 and there is a similar question on how to lowercase a string in Jinja2 回答1: You can use one of the built in filters like lower to transform the

SQL Server - To search case insensitive where the COLLATE Latin1_General_CS_AS is set

邮差的信 提交于 2020-01-16 05:32:08
问题 Parent question - Thanks to Iamdave, part of the problem is solved. Now the challenge is to make the search case insensitive in the db where the following collation is set already: COLLATE Latin1_General_CS_AS I am using this query and it is not working - couldn't match test, Test, could match only TEST UPDATE dbo.BODYCONTENT SET BODY = LTRIM(RTRIM(REPLACE( REPLACE( REPLACE(N' ' + CAST(BODY AS NVARCHAR(MAX)) + N' ', ' ', '<>'), '>TEST<', '>Prod<'), '<>', ' '))) FROM dbo.BODYCONTENT WHERE BODY

Solr case insensitve

泪湿孤枕 提交于 2020-01-15 12:06:18
问题 Hallo, I'am implementing an autocompletion feature in Solr and have one problem. For autocompletion I am using <fieldType name="text_auto" class="solr.TextField" sortMissingLast="true" omitNorms="true"> <analyzer> <tokenizer class="solr.KeywordTokenizerFactory"/> <filter class="solr.LowerCaseFilterFactory" /> </analyzer> </fieldType> I thought that the LowerCaseFilter should make the Token Case insensitiv but that ist wrong. In fact in just lowercases the Token which means that a query like

Solr case insensitve

末鹿安然 提交于 2020-01-15 12:04:34
问题 Hallo, I'am implementing an autocompletion feature in Solr and have one problem. For autocompletion I am using <fieldType name="text_auto" class="solr.TextField" sortMissingLast="true" omitNorms="true"> <analyzer> <tokenizer class="solr.KeywordTokenizerFactory"/> <filter class="solr.LowerCaseFilterFactory" /> </analyzer> </fieldType> I thought that the LowerCaseFilter should make the Token Case insensitiv but that ist wrong. In fact in just lowercases the Token which means that a query like

gcc ignore casing of symbol names while linking

限于喜欢 提交于 2020-01-14 09:32:14
问题 A software I am working on ships with NETLIB BLAS/LAPACK embedded into its sources using all-lowercase symbol names but now while porting the application to windows I discovered that Intel MKL and several other BLAS/LAPACK implementations for this platform use all-uppercase symbol names. Is there a way to tell the gnu compiler/linker to ignore case while matching symbol names? . . . undefined reference to `_dgeqp3' . . . $ nm /lib/LAPACK.lib | grep -i " T _dgeqp3" 00000000 T _DGEQP3 回答1: The

Android ignore case when sorting list

杀马特。学长 韩版系。学妹 提交于 2020-01-13 19:14:08
问题 I have a List named path I'm currently sorting my strings with the following code java.util.Collections.sort(path); That is working fine it sorts my list however it treats the cases of the first letter differently that is it sorts the list with upper-case letters and then sorts the list with lower-case letters after so if I had the following cat dog Bird Zebra it would sort it like Bird Zebra dog cat so how do I ignore case so that dog and cat would come before Zebra but after Bird? Thank you

Display original Sitecore username instead of what's currently typed in

六眼飞鱼酱① 提交于 2020-01-06 08:32:01
问题 I might be overlooking something obvious here, but is it possible to return a Sitecore user with the username in the capitalisation they used when registering? At the moment the username will be displayed as whatever the user typed when they logged in, but I'd like to be able to get the original string. I'm using User user = User.FromName(domainUser, false); UPDATE: This is what I ended up with after Yan's excellent answer: // get the MembershipUser object normally by name var initialUser =

How do I handle uppercase and lowercase characters in a custom url?

↘锁芯ラ 提交于 2020-01-05 07:12:15
问题 I want to let users have links to their profiles using their registered usernames. I store their username exactly how they give it. I set up my routes to match /:name and then used find_by_name to get it. The problem I have is when you type in example.com/username it doesn't work the name: Username. (Note the uppercase/lowercase difference) So my question is how can I ignore case in urls? 回答1: You can store the username downcased along with a display_name which is in the format they gave it