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
4 answers

How to toupper char array in c?

whats wrong here? I want to check if the char in char array islower, so if it is it should be changed in uppercase. #include int main(int argc, char *argv[]) { char arr[100]; scanf("%s",&arr); for(int i=0;i
juliandik
  • 21
  • 1
  • 1
  • 5
0
votes
1 answer

How can I use php function mb_convert_case and convert only certain words to upper?

I want to pass this input $string = "AL & JRL buSineSS CENTRE is the best"; Expected Result: AL & JRL Business Centre Is The Best I have tried the code below but it converts everything. mb_convert_case($string, MB_CASE_TITLE, "UTF-8");
user2635901
  • 203
  • 2
  • 12
0
votes
6 answers

C++ tolower/toupper char pointer

Do you guys know why the following code crash during the runtime? char* word; word = new char[20]; word = "HeLlo"; for (auto it = word; it != NULL; it++){ *it = (char) tolower(*it); I'm trying to lowercase a char* (string). I'm using…
mask
  • 539
  • 1
  • 5
  • 18
0
votes
1 answer

Import CSV File Into R, in Upper Case

Novice R user here... I'm using the code below to import all csv files in a folder: path <- "C:/Users/Daniel/Desktop/Motors/" files <- list.files(path=path, pattern="*.csv") for(file in files) { perpos <- which(strsplit(file, "")[[1]]==".") …
dking16
  • 1
  • 2
0
votes
1 answer

std::string ::toupper on the input string

Can I perform a ::toupper transformation on the same string that is the input? i.e.: std::transform(s.begin(), s.end(), s.begin(), ::toupper); or do I need a different target?
Devolus
  • 21,661
  • 13
  • 66
  • 113
0
votes
1 answer

C++ ::toupper not allowing equality comparison?

I am trying to convert a string to uppercase so I can manipulate it, but while I can successfully manipulate natural uppercase strings, as well as convert lowercase to uppercase, using this method of conversion fails to allow the manipulation. For…
motifesta
  • 49
  • 7
0
votes
2 answers

How this custom toupper() function works?

I've seen following program that uses custom toupper() function. #include void my_toUpper(char* str, int index) { *(str + index) &= ~32; } int main() { char arr[] = "geeksquiz"; my_toUpper(arr, 0); my_toUpper(arr, 5); …
Destructor
  • 14,123
  • 11
  • 61
  • 126
0
votes
1 answer

Facing segmentation fault while using toupper()

The following method causes an error: BOOL should_begin(void) { char yn; do { printf("Continue? [Y/N] "); yn = getchar(); printf("\n"); yn = toupper(yn); if (yn == 'N') { return FALSE; …
PC Luddite
  • 5,883
  • 6
  • 23
  • 39
0
votes
2 answers

why does these toupper work different when utilized like this?

why does one give me an int and the other doesn't?: toupper(member_names[2]); and: member_names[2] = toupper(member_names[2]);
Code971
  • 325
  • 1
  • 2
  • 4
0
votes
0 answers

call ToUpper in expression tree LINQ

I would like to create this LINQ query: Result = Result.Where(Function(Row) Convert.ToString(Row(0)).ToUpper = "TEST") I have this query already: Result = Result.Where(Function(Row) Convert.ToString(Row(0)) = "TEST") with this code: expr =…
derstauner
  • 1,478
  • 2
  • 23
  • 44
0
votes
1 answer

converting std::string to upper case without modifying source

I'm acquainted with the usage of std::transform(data.begin(), data.end(), data.begin(), ::toupper), which can change the string in data to all uppercase. I am wondering, however, if there is a clean solution that can get the all-uppercase version…
markt1964
  • 2,638
  • 2
  • 22
  • 54
0
votes
4 answers

Creating a toUpper function in C

I'm creating my own toUpper function in C, but keep getting a segmentation fault every time I attempt to run it. Can anyone provide me with any hints as to how to fix this problem? int toUpper(char *str) { int i; for(i=0;i< i <= strlen(str);…
amosq
  • 81
  • 1
  • 8
0
votes
1 answer

How to uppercase all first-letter-characters of sentences after specified delimiter in a text file?

Just as the title says, I have text file that has virtually no uppercase letters in it, so all of the sentences don't look proper without the first letter capitalized. Here's my code so far: //This program reads an article in a text file, and…
Sam Peterson
  • 107
  • 1
  • 9
0
votes
1 answer

How can I lowercase an interpolated string inside Perl's qr//?

I'm using Perl Expect module for my SSH connections. I already have a module using sub functions like this: $exp->spawn("ssh -o ConnectTimeout=$connectTimeout $user\@$ip") or die ("unable to spawn \n"); @obj=$exp->expect( $commandTimeout, […
Gui O
  • 363
  • 4
  • 8
  • 22
0
votes
5 answers

c++ toupper() to compare two strings

I have created a set of algorithms that takes an input of a string vector, checks whether any of the strings occur more than once: if so erases all additional occurrences of the string from the vector, then outputs the new, 'lighter' array without…
Jim22150
  • 511
  • 2
  • 8
  • 22