uppercase

Unicode characters having asymmetric upper/lower case. Why?

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-30 18:52:44
Why do the following three characters have not symmetric toLower , toUpper results /** * Written in the Scala programming language, typed into the Scala REPL. * Results commented accordingly. */ /* Unicode Character 'LATIN CAPITAL LETTER SHARP S' (U+1E9E) */ '\u1e9e'.toHexString == "1e9e" // true '\u1e9e'.toLower.toHexString == "df" // "df" == "df" '\u1e9e'.toHexString == '\u1e9e'.toLower.toUpper.toHexString // "1e9e" != "df" /* Unicode Character 'KELVIN SIGN' (U+212A) */ '\u212a'.toHexString == "212a" // "212a" == "212a" '\u212a'.toLower.toHexString == "6b" // "6b" == "6b" '\u212a'

XSLT/XPath : No upper-case function in MSXML 4.0?

醉酒当歌 提交于 2019-11-30 18:02:13
问题 I try to use upper-case() in an XPATH, my parser is MSXML 4.0, and I get : upper-case is not a valid XSLT or XPath function. Is it really not implemented ? 回答1: There are no functions in xslt 1.0 to convert to uppercase or lowercase. Instead do the following: If it is required in a lot of places: Declare these two xsl variables (this is to make the xslt more readable) <!-- xsl variables up and lo and translate() are used to change case --> <xsl:variable name="up" select="

Count the uppercase letters in a string with Python

蓝咒 提交于 2019-11-30 17:05:56
I am trying to figure out how I can count the uppercase letters in a string. I have only been able to count lowercase letters: def n_lower_chars(string): return sum(map(str.islower, string)) Example of what I am trying to accomplish: Type word: HeLLo Capital Letters: 3 When I try to flip the function above, It produces errors: def n_upper_chars(string): return sum(map(str.isupper, string)) You can do this with sum , a generator expression , and str.isupper : message = input("Type word: ") print("Capital Letters: ", sum(1 for c in message if c.isupper())) See a demonstration below: >>> message

Directive to upper case input fields

耗尽温柔 提交于 2019-11-30 15:57:14
I want to use a directive to transform all input data to uppercase. To achieve that, I create this custom directive : @Directive({ selector: '[appToUpperCase]' }) export class ToUpperCaseDirective { constructor() {} @HostListener('input', ['$event']) onKeyUp(event) { event.target['value'] = event.target['value'].toUpperCase(); } } And I use it like that : <form [formGroup]="formGroup" appToUpperCase> It works almost good exept that when I enter text in my field, the upper case transform is permormed but the focus is set at the end of the field...So when I edit a pre filled input, if I want to

How to check for uppercase letters in MySQL?

牧云@^-^@ 提交于 2019-11-30 12:39:58
I want to check, if a string consits only of uppercase letters. I know that RLIKE/REGEXP are not case sensitive in MySQL. So I tried to use the :upper: character class: SELECT 'z' REGEXP '^[[:upper:]]+$'; This gives true, although the z is in lower case,... why? REGEXP is not case sensitive, except when used with binary strings. http://dev.mysql.com/doc/refman/5.7/en/regexp.html So with that in mind, just do something like this: SELECT * FROM `users` WHERE `email` REGEXP BINARY '[A-Z]'; Using the above example, you'd get a list of emails that contain one or more uppercase letters. For me this

How to remove lowercase on a textbox?

风格不统一 提交于 2019-11-30 08:30:45
I'm trying to remove the lower case letters on a TextBox .. For example, short alpha code representing the insurance (e.g., 'BCBS' for 'Blue Cross Blue Shield'): txtDesc.text = "Blue Cross Blue Shield"; string Code = //This must be BCBS.. Is it possible? Please help me. Thanks! Well you could use a regular expression to remove everything that wasn't capital A-Z: using System; using System.Text.RegularExpressions; class Program { static void Main( string[] args ) { string input = "Blue Cross Blue Shield 12356"; Regex regex = new Regex("[^A-Z]"); string output = regex.Replace(input, ""); Console

Python title() with apostrophes

旧城冷巷雨未停 提交于 2019-11-30 07:19:25
问题 Is there a way to use .title() to get the correct output from a title with apostrophes? For example: "john's school".title() --> "John'S School" How would I get the correct title here, "John's School" ? 回答1: If your titles do not contain several whitespace characters in a row (which would be collapsed), you can use string.capwords() instead: >>> import string >>> string.capwords("john's school") "John's School" EDIT: As Chris Morgan rightfully says below, you can alleviate the whitespace

Java Program to test if a character is uppercase/lowercase/number/vowel [closed]

ε祈祈猫儿з 提交于 2019-11-30 07:10:52
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 6 years ago . As I said before, how do I test if the entered character is one of the parameters? I've written this code, but it doesn't seem to run very well(or at all), no errors, however. Also, I need to use the basic code I've used here. Its for school and we lose points if we use things they haven't taught

Notepad++ and regex: how to UPPERCASE specific part of a string / find / replace

本秂侑毒 提交于 2019-11-30 06:59:48
i've been trying for some time now to get this working, but i can't find a solution to this task myself - ok, i'm very new to regex-use but quite interested to learn, hope anybody has some brainfood for me... my text-string is like this - without the numbers... Word1 Word2 word3 (some words in brackets) Word1 (some words in brackets) word1, Word2 (some words in brackets) means: an indefinite number of words (sometimes just one, maybe 2 to 4, sometimes separated by commas) followed by a string in round brackets (the value in the brackets should not change) what i'm looking for is two different

XSLT Stylesheet: Changing text to upper case

和自甴很熟 提交于 2019-11-30 06:38:09
问题 I am using an XSLT stylesheet to create an Excel document from an XML file. One of the values that I am pulling in I want to display as upper case. How is this possible? 回答1: XSLT 2.0 has fn:upper-case() and fn:lower-case() functions. However in case you are using of XSLT 1.0, you can use translate(): <xsl:template match="/"> <xsl:variable name="smallcase" select="'abcdefghijklmnopqrstuvwxyz'" /> <xsl:variable name="uppercase" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'" /> <xsl:value-of select=