ignore-case

Git on windows: Can't switch branch after renaming a file (only changed case)

吃可爱长大的小学妹 提交于 2019-12-04 00:29:34
问题 I'm working with git on windows, and I have a file in my repo, lets say "foo.txt". Today I wanted to rename this file to "Foo.txt" (uppercase). As suggested in this SO question, I used git mv -f foo.txt Foo.txt , which produced the desired result. I proceeded to commit the change to my repo. EDIT: I would like this to be a permanent change, and still be able to checkout commit that predate this change. However, after that I encountered an error upon trying to switch branch: # I'm on branch1

Git on windows: Can't switch branch after renaming a file (only changed case)

假如想象 提交于 2019-12-01 03:19:51
I'm working with git on windows, and I have a file in my repo, lets say "foo.txt". Today I wanted to rename this file to "Foo.txt" (uppercase). As suggested in this SO question , I used git mv -f foo.txt Foo.txt , which produced the desired result. I proceeded to commit the change to my repo. EDIT: I would like this to be a permanent change, and still be able to checkout commit that predate this change. However, after that I encountered an error upon trying to switch branch: # I'm on branch1 git checkout branch2 Aborting error: The following untracked working tree files would be overwritten by

Java Set<String> equality ignore case

爱⌒轻易说出口 提交于 2019-12-01 02:43:41
I want to check if all elements of two sets of String are equal by ignoring the letter's cases. Set<String> set1 ; Set<String> set2 ; . . . if(set1.equals(set2)){ //all elements of set1 are equal to set2 //dosomething } else{ //do something else } However, this equality check doesn't ignore the cases of the string. Is there some other way of doing that? Alternatively you can use TreeSet . public static void main(String[] args){ Set<String> s1 = new TreeSet<String>(String.CASE_INSENSITIVE_ORDER); s1.addAll(Arrays.asList(new String[] {"a", "b", "c"})); Set<String> s2 = new TreeSet<String>(String

SQL- Ignore case while searching for a string

时光毁灭记忆、已成空白 提交于 2019-11-29 20:13:12
I have the following data in a Table PriceOrderShipped PriceOrderShippedInbound PriceOrderShippedOutbound In SQL I need to write a query which searches for a string in a table. While searching for a string it should ignore case. For the below mentioned SQL query SELECT DISTINCT COL_NAME FROM myTable WHERE COL_NAME LIKE '%PriceOrder%' gives all the above data, whereas SELECT DISTINCT COL_NAME FROM myTable WHERE COL_NAME LIKE '%Priceorder%' doesn't give. Eg. when I search for 'PriceOrder' or 'priceOrder' it works but 'priceorder' or 'Priceorder' doesn't work. I have tried with the below query

How to ignore case in String.replace

余生长醉 提交于 2019-11-28 20:06:42
string sentence = "We know it contains 'camel' word."; // Camel can be in different cases: string s1 = "CAMEL"; string s2 = "CaMEL"; string s3 = "CAMeL"; // ... string s4 = "Camel"; // ... string s5 = "camel"; How to replace 'camel' in sentence with 'horse' despite of string.Replace doesn't support ignoreCase on left string? Use a regular expression: var regex = new Regex( "camel", RegexOptions.IgnoreCase ); var newSentence = regex.Replace( sentence, "horse" ); Of course, this will also match words containing camel, but it's not clear if you want that or not. If you need exact matches you can

SQL- Ignore case while searching for a string

a 夏天 提交于 2019-11-28 16:04:45
问题 I have the following data in a Table PriceOrderShipped PriceOrderShippedInbound PriceOrderShippedOutbound In SQL I need to write a query which searches for a string in a table. While searching for a string it should ignore case. For the below mentioned SQL query SELECT DISTINCT COL_NAME FROM myTable WHERE COL_NAME LIKE '%PriceOrder%' gives all the above data, whereas SELECT DISTINCT COL_NAME FROM myTable WHERE COL_NAME LIKE '%Priceorder%' doesn't give. Eg. when I search for 'PriceOrder' or

How to ignore case in String.replace

守給你的承諾、 提交于 2019-11-27 11:56:52
问题 string sentence = "We know it contains 'camel' word."; // Camel can be in different cases: string s1 = "CAMEL"; string s2 = "CaMEL"; string s3 = "CAMeL"; // ... string s4 = "Camel"; // ... string s5 = "camel"; How to replace 'camel' in sentence with 'horse' despite of string.Replace doesn't support ignoreCase on left string? 回答1: Use a regular expression: var regex = new Regex( "camel", RegexOptions.IgnoreCase ); var newSentence = regex.Replace( sentence, "horse" ); Of course, this will also

Java Set<String> equality ignore case

ぃ、小莉子 提交于 2019-11-27 06:34:55
问题 I want to check if all elements of two sets of String are equal by ignoring the letter's cases. Set<String> set1 ; Set<String> set2 ; . . . if(set1.equals(set2)){ //all elements of set1 are equal to set2 //dosomething } else{ //do something else } However, this equality check doesn't ignore the cases of the string. Is there some other way of doing that? 回答1: Alternatively you can use TreeSet . public static void main(String[] args){ Set<String> s1 = new TreeSet<String>(String.CASE_INSENSITIVE