lowercase

Vuejs 2 : How to make data lowercase

放肆的年华 提交于 2020-05-28 14:54:17
问题 I trying to make some data to lowercase (alway lowercase) I making and search input like : <template id="search"> <div> <input type="text" v-model="search"> <li v-show="'hello'.includes(search) && search !== ''">Hello</li> </div> </template> Vuejs : (component) Vue.component('search', { template : '#search', data: function(){return{ search : '', }} }); I tried watch , But I dont want input showing lowercase when typing watch: { 'search' : function(v) { this.search = v.toLowerCase().trim(); }

Capitalize the first letter of each word in a filename with powershell

梦想的初衷 提交于 2020-04-29 08:01:18
问题 I want to change the names of some files automatically. With this code I change the lowercase letters to uppercase: get-childitem *.mp3 | foreach { if ($ .Name -cne $ .Name.ToUpper()) { ren $ .FullName $ .Name.ToUpper() } } But I only want the first letter of each word to be uppercase. 回答1: You can use ToTitleCase Method: $TextInfo = (Get-Culture).TextInfo $TextInfo.ToTitleCase("one two three") outputs One Two Three $TextInfo = (Get-Culture).TextInfo get-childitem *.mp3 | foreach { $NewName =

Capitalize the first letter of each word in a filename with powershell

心不动则不痛 提交于 2020-04-29 08:00:18
问题 I want to change the names of some files automatically. With this code I change the lowercase letters to uppercase: get-childitem *.mp3 | foreach { if ($ .Name -cne $ .Name.ToUpper()) { ren $ .FullName $ .Name.ToUpper() } } But I only want the first letter of each word to be uppercase. 回答1: You can use ToTitleCase Method: $TextInfo = (Get-Culture).TextInfo $TextInfo.ToTitleCase("one two three") outputs One Two Three $TextInfo = (Get-Culture).TextInfo get-childitem *.mp3 | foreach { $NewName =

Convert first lowercase to uppercase and uppercase to lowercase (regex?)

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-15 06:14:09
问题 I have a huge file in this layout: world12345:Betaalpha world12344:alphabeta world12343:ZetaBeta world12342:!betatheta I need to convert the first lowercase letter after the ":" to uppercase and the first uppercase letter to lowercase. I've tried using notepad++ and emeditor, but I'm not that experienced with regex. This is how I want it to become after (regex?) world12345:betaalpha world12344:Alphabeta world12343:zetaBeta world12342:!betatheta (unchanged, as the first char is a special char)

Convert first lowercase to uppercase and uppercase to lowercase (regex?)

狂风中的少年 提交于 2020-01-15 06:11:05
问题 I have a huge file in this layout: world12345:Betaalpha world12344:alphabeta world12343:ZetaBeta world12342:!betatheta I need to convert the first lowercase letter after the ":" to uppercase and the first uppercase letter to lowercase. I've tried using notepad++ and emeditor, but I'm not that experienced with regex. This is how I want it to become after (regex?) world12345:betaalpha world12344:Alphabeta world12343:zetaBeta world12342:!betatheta (unchanged, as the first char is a special char)

How to convert a string from uppercase to lowercase in Bash? [duplicate]

旧城冷巷雨未停 提交于 2020-01-09 12:22:35
问题 This question already has answers here : How to convert a string to lower case in Bash? (21 answers) Closed 2 years ago . I have been searching to find a way to convert a string value from upper case to lower case. All the search results show approaches of using tr command. The problem with the tr command is that I am able to get the result only when I use the command with echo statement. For example: y="HELLO" echo $y| tr '[:upper:]' '[:lower:]' The above works and results in 'hello', but I

PHP Ucwords with or and special characters

此生再无相见时 提交于 2020-01-06 04:13:05
问题 Here is what I'm doing. I have a couple of strings that is uppercase †HELLO THERE DAY OR NIGHT So to convert them, I'm using the following code: ucwords(strtolower($string)); Here is the end result: †hello There Day Or Night How can I ignore the † or any special characters so it the words can show †Hello There and how can I keep words like or all lowercase. 回答1: Try: print preg_replace_callback('#([a-zA-ZÄÜÖäüö0-9]+)#',function($a){ return ucfirst(strtolower($a[0])); }, '†hello THERE' ); [a

PHP Ucwords with or and special characters

青春壹個敷衍的年華 提交于 2020-01-06 04:13:04
问题 Here is what I'm doing. I have a couple of strings that is uppercase †HELLO THERE DAY OR NIGHT So to convert them, I'm using the following code: ucwords(strtolower($string)); Here is the end result: †hello There Day Or Night How can I ignore the † or any special characters so it the words can show †Hello There and how can I keep words like or all lowercase. 回答1: Try: print preg_replace_callback('#([a-zA-ZÄÜÖäüö0-9]+)#',function($a){ return ucfirst(strtolower($a[0])); }, '†hello THERE' ); [a

Swapping uppercase and lowercase in a string

寵の児 提交于 2020-01-03 14:01:23
问题 I would like to change the chars of a string from lowercase to uppercase. My code is below, the output I get with my code is a ; could you please tell me where I am wrong and explain why? Thanks in advance test = "AltERNating" def to_alternating_case(string): words = list(string) for word in words: if word.isupper() == True: return word.lower() else: return word.upper() print to_alternating_case(test) 回答1: If you want to invert the case of that string, try this: >>> 'AltERNating'.swapcase()

JavaScript replace lowercase uppercase

橙三吉。 提交于 2020-01-03 05:19:51
问题 I want to replace something (variable -> I call it "x" here) in a text (variable) with 'string'+x+'string'. My code: new_content = content.replace(new RegExp(x,"gi"),'string'+x+'string'); So I want to replace upper and lowercase x and the x in 'string'+x+'string' should be lowercase if the search x is lowercase as well. And the same thing for uppercase. Is there a way like $1 for this situation? 回答1: You can use $& in the replacement string to insert the matched string: new_content = content