uppercase

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 =

Is there a reason to use uppercase letters for hexadecimal CSS color values?

谁都会走 提交于 2020-02-19 08:59:21
问题 I see that colors in CSS properties values are commonly written in the uppercase form: .foo .bar { background-color: #A41B35; color: #FFF; } But you can also use: /* Same same */ .foo .bar { background-color: #a41b35; color: #fff; } It looks like using lowercase values does the same, and, CSS values for colors are not case-sensitive. Lots of graphic design software also use the uppercase form. And it is very common to find uppercase notations in source code, it looks like there is something

How to append characters to a string array in C

走远了吗. 提交于 2020-01-25 06:48:06
问题 I'm very new to C and I'm trying to write a program that checks if a string contains any uppercase letters, and if it does, prints them out. I'm using https://www.onlinegdb.com/online_c_compiler# as my compiler (cause I don't have access to my personal computer right now) and after a test run, the results are (p.s. I know gets isn't safe): main.c:16:5: warning: ‘gets’ is deprecated [-Wdeprecated-declarations] /usr/include/stdio.h:638:14: note: declared here main.c:(.text+0x26): warning: the

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)

Jackson - converting java object to json - Need all key keys to upper case

∥☆過路亽.° 提交于 2020-01-11 05:46:07
问题 Need your help on conversion of java objects to json. current the json result showing all the key in small letter case, i need it to be upper case. ObjectMapper mapper = new ObjectMapper(); Writer strWriter = new StringWriter(); mapper.writeValue(strWriter, obj); String jsonString= strWriter.toString(); and the result is [{"flags":"1","name":"Peter","location":"London","startDate":"2012-01-06 00:00"}] but i want results like this (all key key value should be in UPPER CASE): [{"FLAGS":"YU",

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

Class name convention in java [closed]

ぃ、小莉子 提交于 2020-01-09 02:30:14
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 6 years ago . What is the naming convention of classes in java, for example should all classes be in upper case like MYCLASS.java ? as some classes

I need to uppercase all characters of Android textview

筅森魡賤 提交于 2020-01-06 13:54:21
问题 I know about using setAllCaps(true) but it requires me to use API14 as min, and I would like to keep API 9 as min, so I would like to know if anyone has found a way to capitalize all characters of all textViews in certain layout? 回答1: One could easily extend the TextView and change the text case there manually. Example: package com.example.allcapstextview; import android.content.Context; import android.util.AttributeSet; import android.widget.TextView; import java.util.Locale; public class