Just imagine I have defined a list of static variables in lower case on my editor.
Is there any option in intellij where I can select a portion of my source code and convert it into either upper/lower case?
I am asking the user to input a password. The program then determines if the password is valid if it meets certain criteria.
Here is the section in question.
for i in range(0, len(password)): if(password[i].isdigit()==True): isNum+=1 elif (password[i].isalpha()==True): isLetter+=1 elif (password[i].isupper()==True): isUpper+=1
My program detects numbers and letters just fine, but it doesn't detect uppercase letters. If I put in the password 1234Foxes, it will say that there are 4 letters, 4 numbers, and 8 total characters, but it states that there are 0 uppercase letters.
Is there a function built into Java that capitalizes the first character of each word in a String, and does not affect the others?
Miles O'Brien(B remains capital, this rules out Title Case)
Old McDonald would be find too, but I don't expect it to be THAT smart.)
A quick look at the Java String Documentation reveals only
toLowerCase(), which of course do not provide the desired behavior. Naturally, Google results are dominated by those two functions. It seems like a wheel that must have been invented already, so it couldn't hurt to ask so I can use it in the future.
I'm trying to convert column value from CamelCase to underscore_case, this is what I tried :
SELECT regexp_replace(ColumnName, '([A-Z])', '_\1', 2) FROM Table;
but this will return
d_a_r_k_C_y_a_n for the value
How can I resolve this ?
Alright, so I am making a Discord bot, and I'm trying to set parameters for words that aren't allowed to be said in the server (You know the kind, slurs and the like). So, I put a slur (I'll just use the word "dog" as an example), but it was only lowercase. So basically, it's just "dog", and if someone says "dog" in chat, then their message will be deleted, and the bot sends them a message through DMs. But, if someone were to say "Dog", then they wouldn't get their message deleted. What should I add to the code to make sure that all variations of the slur get picked up?
I'm incredibly new to any form of coding, and I have gotten a ton of help from my friends to make this bot, so I really have no clue about what I'm doing.
(if you want to see the code, here it is. I replaced all the slurs with words, but I think you get the gist):
"bannedWords":[ "apple", "dog", "bird", "cat" ], "code":""}
I expect the words "dog", "Dog", "DOg", "DOG", "dOG", "doG", "DoG", "dOg", etc. to be identified instead of just "dog".