FAQ Database Discussion Community


Why isn't the first character uppercase?

java,string,char,uppercase,lowercase
I have found syntax that is supposed to change the first character from a lowercase letter to an uppercase letter. For some reason my program won't! When I type a 'm' instead of 'M'. What am I doing wrong here? public static void main(String[] args) { System.out.print("Enter two characters: ");...

R Convert list to lowercase

r,list,lowercase
Var1 is a list: var1 <- list(c("Parts of a Day", "Time in Astronomy", "Star"), c("Tree Tall", "Pine Tree")) How to convert all the characters to lowercase? The desired answer is the following list: var1 <- list(c("parts of a day", "time in astronomy", "star"), c("tree tall", "pine tree")) I used as.list(tolower(var1))...

Convert java char inside string to lowerCase/upperCase

java,string,character,uppercase,lowercase
I have a String called "originalstring" which contains a sentence with mixed upper and lower case characters. I simply want to flip the string so that if a character is a lowercase make it upper case and vice versa and return it. I have tried this code, which returns the...

Python get file regardless of upper or lower

python,python-2.7,glob,uppercase,lowercase
I'm trying to use this on my program to get an mp3 file regardless of case, and I've this code: import glob import fnmatch, re def custom_song(name): for song in re.compile(fnmatch.translate(glob.glob("../music/*"+name+"*.mp3")), re.IGNORECASE): print (song) custom_song("hello") But when I execute the script i get the following error: File "music.py", line 4,...

C++ - Counting the number of vowels from a file

c++,string,file,counting,lowercase
I'm having trouble implementing a feature that counts and displays the number of vowels from a file. Here is the code I have so far. #include <iostream> #include <fstream> #include <string> #include <cassert> #include <cstdio> using namespace std; int main(void) {int i; string inputFileName; string s; ifstream fileIn; char ch;...

pointer sentence case (C)

c,pointers,uppercase,lowercase,sentencecase
I have problem to output text in sentence case characters. When I prompt: heLLo! heLLo. i am OKAY. I'm expecting output: Hello! Hello. I am okay. But my sample run output is: Hello! hello. i am okay. My code cannot output uppercase after '!'/'.'/'?'/'_' Anybody can advise what mistake that...

Bash convert file to lowercase and sort

bash,sorting,awk,lowercase,ifs
I am trying to write a script that will take in an inputFile, convert it to lowercase, sort it, and then store the results back in the original file. I'm fairly new to bash, so this is the solution I've come up with so far: awk '{ print tolower($0) }'...

Change lowercase and uppercase of characters in java

java,unicode,mapping,uppercase,lowercase
If I want to create a dictionary where the user can create a custom alphabet (that still uses unicode) Is there a way to change lowercase and uppercase mapping of the characters? Let's say I want the lowercase of 'I' to be 'ı' instead of 'i' or upperCase of 'b'...

How to check the right login data in access form

vba,login,access-vba,uppercase,lowercase
I've created a nice login form in access. The problem is that I can login altough I use upper- or lowercase for the username or password... How can I check the right login data which are in the table? I use this code at the moment: If Nz(DLookup("Login", "Employee", _...

Changing a variable in a list of dataframes in R

r,loops,lowercase,sapply
I have 7 dataframes where the first variable is just a list of the 50 states. The problem is that in some of them, the states are all capitals, all lower case or mixed. Instead of writing 7 different tolower() commands, I was wondering if there is a way to...

String replacement (to lowercase) in Bash 4.3.33 - bad substitution error

string,bash,replace,substitution,lowercase
I'm trying to change uppercase to lowercase using string replacement in bash, but i'm getting a bad substitution error. > a=HEY > echo $a HEY > echo ${a,,} -bash: ${a,,}: bad substitution # desired output is hey I've seen similar questions to this, but in most cases it was down...

How can I convert a csv file to lowercase or uppercase maintaining it's structure using powershell?

powershell,csv,uppercase,lowercase
I have a CSV file that with contents that needs to be converted to all lowercase I have tried the code below but it doesn't maintain the CSV structure. (Get-Content C:\_Scratch\export.csv).ToLower() | Out-File C:\_scratch\export.csv $Init = Import-Csv C:\_Scratch\export.csv Is there another option I can try?...

Replacing Strings Java

java,string,replace,buffer,lowercase
I have this function to check if some words appear in a specific line, and then surround them with a given char. The code above works like a charm, however since the words in the string array "words" are always low case, the words will be lower case as well....

Hive: apply lowercase to an array

java,arrays,string,hive,lowercase
In Hive, how do I apply the lower() UDF to an Array of string? Or any UDF in general. I don't know how to apply a "map" in a select query

Delete Words w/Upper And Lowercase Letters or Only Lowercase Letters

sql,ms-access,delete,uppercase,lowercase
Objective: I have an Access table with a column Item_Desc. I want this column to only contain the brand names of clothing. The brand names are always written in ALL CAPS, e.g., "RALPH LAUREN". Problem: The Item_Desc column is populated with both brand names and type of article of clothing...

if/else statements accepting strings in both capital and lower-case letters in python

python,if-statement,uppercase,lowercase,capitalize
Is there a quick way for an "if" statement to accept a string regardless of whether it's lower-case, upper-case or both in python? I'm attempting to write a piece of code where the number "3" can be entered as well as the word "three"or "Three" or any other mixture of...

Code not working - upper and lower - Python [duplicate]

python,uppercase,lowercase
This question already has an answer here: Why doesn't calling a Python string method do anything unless you assign its output? 2 answers The below is my code, and as you can guess, I am trying to change the input's first to upper, and rest to lower. name =...

Looping Over a String Gives Segmentation Fault

c++,string,replace,lowercase
I'm writing a function to make a string lowercase in C++. It works perfectly fine, but after the last character, it gives a segmentation fault. My code is below: #include <cctype> #include <string> #include <iostream> using namespace std; string lowercase(string str) { string ans = str; for (int i=0; i...

Why doesn't if, elif or else work with .lower() in Python? [closed]

python,if-statement,python-3.x,lowercase
The program needs to accept and match any upper and lower case versions of the word, which is why .lower() is used. When this is ran and 'January' is entered, the else line is printed instead of the if line. month = input("\nPlease enter the month\n") if month.lower == ("january"):...