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.
Questions tagged [toupper]
176 questions
0
votes
1 answer
Is opening and closing the same file multiple times a bad practice in C?
my C program does 3 things:
reads from a text file
converts all letters into upper-case
prints the converted text into the console.
Here are how many times I'm opening and closing those 2 files in my program:
Original => 1 for "r"
New => 2 first…

mushjoon
- 11
- 3
0
votes
2 answers
C# How do I get search function to find and display both title and post in console window?
I am new at C# and I´m having problem to understand what I am doing wrong in this code (case 3)? I have made some changes to the code, but now it wont find the posts, only the title. At least its only displaying the title. I am very greatful for any…

user17735694
- 11
- 2
0
votes
3 answers
Characters to uppercase with C#. Jaden Casing Strings kata
This is my first question here. I'm trying to improve my basics by doing Code Wars exercises and I'm supposed to change the first character of every word to uppercase.
Example: This is my life now --> This Is My Life Now
This is my code at the…

AoLoim
- 9
- 3
0
votes
0 answers
$Var.ToUpper() throwing "You cannot call a method on a null-valued expression."
Everyone.
I'm not sure why this is happening, but in my PowerShell script I am converting a string (server name entered by the end user) to uppercase. My trouble is that when I run my script it throws the error "You cannot call a method on a…

Dalebert
- 35
- 4
0
votes
2 answers
I'm having trouble converting argv to upper in C
I'm trying to convert a fixed size argv to upper and to lower but It either gives me segmentation fault or it just stores gibberish on the var. I've tried this:
#include
#include
#include
#include
#include…

Miguel M
- 302
- 3
- 16
0
votes
2 answers
Creating a function in R that capitalizes ONLY the first n elements of a vector
I want to create a function (v,n) where v is a vector of string values and n is an integer number. This function should capitalize only the first n elements of the vector. And if n is greater than the length(v), it should capitalize all the elements…

Daniela D
- 47
- 5
0
votes
1 answer
Why is a character converted to a digit when using toupper?
tinyc.h
#ifndef _TINYC_H
#define _TINYC_H
#include
#include
#include

Jack Murrow
- 396
- 3
- 11
0
votes
2 answers
How do i convert all alphabets to uppercase using transform ignoring digits?
I need to convert only letters in the string to uppercase and tried this piece of code which throws an error.
s = "Dense-123-Sparse-999"
std::transform(s.begin(), s.end(), s.begin(), std::toupper);
Expected Output:…

ElevenCents
- 63
- 9
0
votes
2 answers
Capitalize a single letter instead of the entire sentence
How do I uppercase for example letter "i"? I tried transform, convert. Now, I think using a for loop may be the best option, but cannot seem to figure it out!
#include
#include
using namespace std;
int main()
{
string s = "this…

AnsBekk
- 59
- 6
0
votes
5 answers
C++ "toupper" not converting character to uppercase
I'm trying to convert every letter in a string to uppercase. I'm looping through each character and using toupper on it. However, when I print the new string out, it's not working. Sorry if this is a newbie question. Any help would be greatly…
user14043389
0
votes
3 answers
Need help converting the string stored in "role" to uppercase letters using the .toUppecase() method
let firstName = "Sean";
let lastName = "Bowden";
let role = 'developer';
var msg = firstName + " " + lastName + ": " + role + ".";
I need to convert the role variable to all upper case letters using the .toUpperCase() method.
Output will be: Sean…
0
votes
2 answers
Function to randomly convert chars toupper case
Am revisiting an exercise from an online course where we created a 'Whale translator' which checks through each character that the user inputs and extracts / returns only the vowels.
I thought it would be fun to have the returned values capitalized…

lbc4ever
- 3
- 4
0
votes
1 answer
problem to uppercase some Turkish characters as "i" to "İ" in R studio
When I make "İzmir" uppercase it becomes "İZMIR".
I need it to be "İZMİR"
I use UTF-8 encoding for a column as Encoding(dt[[4]]) <- "UTF-8"
I observed the problem occurs with "i"
I need your help
Thanks in advance

genco
- 35
- 6
0
votes
2 answers
to upper case every words in file in C
can you tell me what adjustments i can do for my code, or any simplifications? What shouldn't
i repeat, what should i change ? This code converts every word to upper case, if you find some problems,pls write in order to fix it))
#include…

Kevin
- 11
- 4
0
votes
3 answers
How to count all uppercase characters in a string?
I stuck on a function that supposed to count upper letters in a string. But instead the counter results in 0 and I've no idea where I made a mistake.
const bigLettersCount = (str) => {
let result = 0;
for (let i = 0; i < str.length; i += 1) {
…

Markus
- 15
- 5