uppercase

toupper function

三世轮回 提交于 2019-12-12 03:28:55
问题 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, char **argv) { char **a = malloc(sizeof(char *) * (argc)); int i; for(i = 0; i < argc; i++) { int size = strlen(argv[i]); a[i] = malloc(sizeof(char) * (size + 1)); strcpy(a[i], argv[i]); a[i] = toupper(a[i]); } return a; } If I test this with "one

Turning numbers into uppercase numbers with NSAttributedString/NSString and UILabel

巧了我就是萌 提交于 2019-12-12 00:19:40
问题 I'm using a font here that has different looks for uppercase and lowercase numbers. This works perfectly in text editors, and Adobe's tools (by settings labels to uppercase only), and I figured this would work in UIKit as well by just running the string through the uppercaseString method, but it doesn't seem to actually turn the numbers into their uppercase versions. So… How can I turn numbers into uppercase in UIKit? Can I? 回答1: This blog post may help. Also note that while there are quite a

Change String value to uppercase in a C++ header file?

♀尐吖头ヾ 提交于 2019-12-11 20:21:26
问题 I'm trying to convert a String to uppercase in my header file function. However, when I try to do this I get an error saying "Cannot convert from 'class String' to 'char'. Here's my code - #ifndef PATIENT_DEMO_CLASS #define PATIENT_DEMO_CLASS // system defined preprocessor statement for cin/cout operations #include <iostream.h> // header file from book #include "tstring.h" #include <algorithm> #include <string> class PatientDemographicInformation { private: // patient's state String

Assembly emu8086, reversing a string

对着背影说爱祢 提交于 2019-12-11 07:15:22
问题 I am trying to make a program where the user have to enter a string and get an reversed output. Moreover, it should change all lowercase letters to uppercase and uppercase to lowercase. I've already done program where you can enter 1 character. My next goal is to get as many characters as I want. I did some research and came up with this code: org 100h include emu8086.inc .DATA STR1 DB 0DH,0AH, 'Input: $' STR2 DB 0DH,0AH, 'Output: $' nl db 0dh,0ah,'$' .CODE START: MOV AX, @DATA MOV DS, AX cmp

Need to save text to database in uppercase

自闭症网瘾萝莉.ら 提交于 2019-12-11 05:58:23
问题 I have an asp 4.0 page using a formview and C# code as needed. I have a textbox for "Street Name" add/edit. I have already used CSS text-transform:uppercase which converts the "look" of the text entered to uppercase however the underlying text is in the case used when typing. I need to save the text in my sql database as uppercase. I have played with various forms of the FindControl on the backend with no luck. I can assign a new variable and populate with the textbox text then change the

Javascript/jQuery uppercase first letter of variable with accents

拥有回忆 提交于 2019-12-11 04:35:56
问题 I have a form with some text inputs to insert First Name , Last Name of a person, but I want to change the first letter of each word to a Uppercase and I found this solution: // The textboxes with this class are modified $(".toUpper").change(function () { var str = $(this).val(); str = str.toLowerCase().replace(/\b[a-z]/g, function (letter) { return letter.toUpperCase(); }); $(this).val(str); }); and it works, ("hEllO"=>"Hello", "whAts uP" =>"Whats Up") . The problem occurs when I try to

VBA: Put a space after or before a upppercase letter in a string

╄→гoц情女王★ 提交于 2019-12-11 04:29:32
问题 I have a sequence of texts that represent customers names, but they do not have spaces between each word/name (for example: JohnWilliamsSmith ). However the words can be differentiated because the first letter of each word is uppercase. So I need to transpose this list of customers strings to their regular format, with spaces between each word. So I want JohnWilliamsSmith to become John Williams Smith . However, I couldn't think of an immediate way to achieve this, and I believe that no

Why can't I use a specific collation in MySQL?

♀尐吖头ヾ 提交于 2019-12-10 23:23:00
问题 I have a table with the character set latin1 (checked by show variables like "character_set_database"; ) and a default collation of latin1_swedish_ci (checked by SHOW TABLE STATUS; ). I'd like to run a query using the collation latin1_general_cs , which is compiled on my system (checked by Show collation LIKE "%_cs"; ): select * from myTab WHERE col RLIKE '[[:upper:]]' COLLATE 'latin1_general_cs' LIMIT 10; which gives an error: ERROR 1253 (42000): COLLATION 'latin1_general_cs' is not valid

Regex matching uppercase characters with lowercase search

[亡魂溺海] 提交于 2019-12-10 20:50:45
问题 I'm using notepad++ and I'm finding that when I use regex to search for strings where I specifically want to find lowercase letters ("[a-z]") it will sometimes return uppercase letters. I originally was searching using the string: ^[A-Z][a-z].+?$ With the purpose of deleting any line in my file that began with an uppercase character, followed by a lowercase, followed by anything until the end of the line. However, this returned lines like, "CLONE" and "DISEASE" which were only capital letters

Uppercase accented characters in perl

故事扮演 提交于 2019-12-10 20:41:39
问题 Is there a way to uppercase accented characters in perl, my $string = "éléphant"; print uc($string); So that it actually prints ÉLÉPHANT ? My perl script is encoded in ISO-8859-1 and $string is printed in an xml file with the same encoding. 回答1: perl only understands US-ASCII and UTF-8, and the latter requires use utf8; If you want to keep the file as iso-8859-1 , you'll need to decode the text explicitly. use open ':std', ':encoding(locale)'; use Encode qw( decode ); # Source is encoded