Questions tagged [toupper]

In C / C++ toupper function converts a given character to uppercase according to the character conversion rules defined by the currently installed C locale. In the default "C" locale, the following lowercase letters abcdefghijklmnopqrstuvwxyz are replaced with respective uppercase letters ABCDEFGHIJKLMNOPQRSTUVWXYZ.

176 questions
0
votes
1 answer

Compilation error while editing a string

Anyone knows why it tells me can't edit chaine it's in read only ?! public static string FormaterChainePascalOuMixte(String chaine) { for (int i = 0; i < chaine.Length; i++) { char xxx = char.ToUpper(chaine[i]); …
user2180198
  • 5
  • 2
  • 3
0
votes
4 answers

Capitalize the first letter, lower case the rest

I am asking a user to enter their name and I want to automatically format the name so that, no matter how they enter the name, it will appear as capital first letter, lower case the rest. For example, if they enter "joHN" the program will still…
user2999339
  • 11
  • 1
  • 1
  • 3
0
votes
3 answers

How to change first letter to uppercase in array of pointers to strings?

I have arrays of pointers to char arrays as below. char *ptrArticle[]={"the","a","one","some"}; I am trying to randomize a sentence like this: "The girl skipped under a boy." So I have to make first words first character uppercase. But this does…
Lyrk
  • 1,936
  • 4
  • 26
  • 48
0
votes
2 answers

How to keep the spaces in a string while doing for loop in tcl

HI I have a string like { Its A Very Good Day! Isn't It }. I have to change all the first letter of every word to lower case but the spaces should also be there. For changing to upper case I have used the following code but I do not know how to…
user2533429
  • 175
  • 1
  • 6
  • 13
0
votes
2 answers

Change every other alpha character in a string to uppercase using C

Would someone kindly steer me in the proper direction with the following code I have written. Basically I'm trying to have every other character in a string be printed in an uppercase letter, all while not taking spaces or other non alpha characters…
user2153167
  • 33
  • 1
  • 2
  • 4
0
votes
1 answer

toupper function

I am wondering how the toupper() function in C works. I am trying it out in the code below but I'm definitely doing something wrong. The code compiles, but the arguments passed into toupper() are not being capitalized... char **copyArgs(int argc,…
user1889966
  • 165
  • 1
  • 4
  • 11
-1
votes
1 answer

Output is letter by letter after converting to uppercase to negate case sensitivity

I am trying to figure out what is causing my function to output letter by letter on separate lines after converting from a lowercase string to all uppercase, in an effort. My assignment is asking us to write a program that asks the user for a…
-1
votes
4 answers

How do I capitalize every third character in my code C#?

I'm learning about C# but there is something that's frustrating me. I was learning about strings methods and how they work. public static void CaseFlip() { Console.WriteLine(" CaseFlip -- Output"); …
-1
votes
3 answers

Convert to all upper case letter bug in C

I'm a noob so please explain why the following code isn't working? It prints an unnecessary Case 1:. I assume it's not scanning using fgets the first time in the Test Case loop. Please someone tell me why. #include #include…
-1
votes
1 answer

error using mutate_all toupper since string is of the form "13corte4"

I am performing a mutate_all such as: nome.serie <- "13corte4" nome.serie <- mutate_all(nome.serie, funs=toupper) but I get the following error: Error in UseMethod("tbl_vars") : no applicable method for 'tbl_vars' applied to an object of class…
-1
votes
3 answers

Capitalize function not working properly

I'm learning the basics in c++ and I'm trying to write a simple function that capitalizes every letter of each word in a given input. What I've written: #include #include #include #include int main() { …
b_rabbit
  • 61
  • 5
-1
votes
1 answer

String will not convert to uppercase when placed as argument value

I am trying to place a dynamic argument value in a onclick function. The problem is that it seems to convert it to lowercase as well as adds an extra space in front of it. Any help would be greatly appreciated, thank you. Here is a codepen.io of my…
Travis Michael Heller
  • 1,210
  • 3
  • 16
  • 34
-1
votes
1 answer

How to get the first 4 letters to be uppercase letter in the next Textbox?

New to programing and its a user/password generator. I want to have the first 4 letters in every name from the left textbox and the result should be 4 uppercase letters (i) same 4 uppercase letter / password generated ex: Adair Ewing Zorro…
-1
votes
5 answers

C++ toupper Syntax

I've just been introduced to toupper, and I'm a little confused by the syntax; it seems like it's repeating itself. What I've been using it for is for every character of a string, it converts the character into an uppercase character if…
Glenn Jansson
  • 31
  • 1
  • 8
-1
votes
1 answer

Splitting strings and printing the capitalized first characers in C

I am working on a code that takes the string containing the name of someone and prints the initials of that name capitalized, whenever I run my code, I keep getting the initials printed twice, which I don't know how to fix this issue and get the…