uppercase

In Android EditText, how to force writing uppercase?

徘徊边缘 提交于 2019-11-26 07:59:54
问题 In my Android application I have different EditText where the user can enter information. But I need to force user to write in uppercase letters. Do you know a function to do that? 回答1: Android actually has a built-in InputFilter just for this! edittext.setFilters(new InputFilter[] {new InputFilter.AllCaps()}); Be careful, setFilters will reset all other attributes which were set via XML (i.e. maxLines , inputType , imeOptinos ...). To prevent this, add you Filter(s) to the already existing

Is it bad to use uppercase letters for html tags?

試著忘記壹切 提交于 2019-11-26 07:39:28
问题 What is the best practice? <HTML> or <html> And why we should stick with one particular case? However all browsers seems to interpret both cases and returns the expected output. 回答1: The lower-case "requirement" is a legacy of xHTML, which explicitly required it. Plain old HTML on the other hand does not follow the rigid struct requirements of XML, and does not therefore have the fixed requirement for use of case However developers have tended to stick with lower case as a convention anyway,

Use Java and RegEx to convert casing in a string

浪子不回头ぞ 提交于 2019-11-26 04:51:14
问题 Problem: Turn \"My Testtext TARGETSTRING My Testtext\" into \"My Testtext targetstring My Testtext\" Perl supports the \"\\L\"-operation which can be used in the replacement-string. The Pattern-Class does not support this operation: Perl constructs not supported by this class: [...] The preprocessing operations \\l \\u, \\L, and \\U. https://docs.oracle.com/javase/10/docs/api/java/util/regex/Pattern.html 回答1: You can't do this in Java regex. You'd have to manually post-process using String

Using upper-case and lower-case xpath functions in selenium IDE

旧街凉风 提交于 2019-11-26 04:49:05
问题 I am trying to get a xpath query using the xpath function lower-case or upper-case , but they seem to not work in selenium (where I test my xpath before I apply it). Example that does NOT work: //*[.=upper-case(\'some text\')] I have no problem locating the nodes I need in complex path and even using aggregated functions, as long as I don\'t use the upper and lower case. Has anyone encountered this before? Does it make sense? Thanks. 回答1: upper-case() and lower-case() are XPath 2.0 functions.

Convert an entire range to uppercase without looping through all the cells

亡梦爱人 提交于 2019-11-26 04:26:47
问题 right now I\'m using the following code to convert a list of ticker symbols from lowercase to upper case letters: Dim Tickers As String Dim n As Integer For n = 2 To Last Tickers = UCase(W.Cells(n, 1).Value) W.Cells(n, 1).Value = Tickers Next n Is there a method I can use to convert the whole range in one line? something like: Range(\"A1:A20\").convertouppercasesomehow 回答1: Is there a method I can use to convert the whole range in one line? Yes you can convert without looping. Try this Sub

Replace a Regex capture group with uppercase in Javascript

↘锁芯ラ 提交于 2019-11-26 03:39:02
问题 I\'d like to know how to replace a capture group with its uppercase in JavaScript. Here\'s a simplified version of what I\'ve tried so far that\'s not working: > a=\"foobar\" \'foobar\' > a.replace( /(f)/, \"$1\".toUpperCase() ) \'foobar\' > a.replace( /(f)/, String.prototype.toUpperCase.apply(\"$1\") ) \'foobar\' Would you explain what\'s wrong with this code? 回答1: You can pass a function to replace . var r = a.replace(/(f)/, function(v) { return v.toUpperCase(); }); Explanation a.replace( /

Upper vs Lower Case

有些话、适合烂在心里 提交于 2019-11-26 03:17:28
问题 When doing case-insensitive comparisons, is it more efficient to convert the string to upper case or lower case? Does it even matter? It is suggested in this SO post that C# is more efficient with ToUpper because \"Microsoft optimized it that way.\" But I\'ve also read this argument that converting ToLower vs. ToUpper depends on what your strings contain more of, and that typically strings contain more lower case characters which makes ToLower more efficient. In particular, I would like to

SQL Server: Make all UPPER case to Proper Case/Title Case

馋奶兔 提交于 2019-11-26 03:07:21
问题 I have a table that was imported as all UPPER CASE and I would like to turn it into Proper Case. What script have any of you used to complete this? 回答1: Here's a UDF that will do the trick... create function ProperCase(@Text as varchar(8000)) returns varchar(8000) as begin declare @Reset bit; declare @Ret varchar(8000); declare @i int; declare @c char(1); if @Text is null return null; select @Reset = 1, @i = 1, @Ret = ''; while (@i <= len(@Text)) select @c = substring(@Text, @i, 1), @Ret =

How do I lowercase a string in Python?

你说的曾经没有我的故事 提交于 2019-11-25 23:51:21
问题 Is there a way to convert a string from uppercase, or even part uppercase to lowercase? For example, \"Kilometers\" → \"kilometers\". 回答1: Use .lower() - For example: s = "Kilometer" print(s.lower()) The official 2.x documentation is here: str.lower() The official 3.x documentation is here: str.lower() 回答2: How to convert string to lowercase in Python? Is there any way to convert an entire user inputted string from uppercase, or even part uppercase to lowercase? E.g. Kilometers --> kilometers

How to convert a string to lower case in Bash?

旧巷老猫 提交于 2019-11-25 23:38:35
问题 Is there a way in bash to convert a string into a lower case string? For example, if I have: a=\"Hi all\" I want to convert it to: \"hi all\" 回答1: The are various ways: POSIX standard tr $ echo "$a" | tr '[:upper:]' '[:lower:]' hi all AWK $ echo "$a" | awk '{print tolower($0)}' hi all Non-POSIX You may run into portability issues with the following examples: Bash 4.0 $ echo "${a,,}" hi all sed $ echo "$a" | sed -e 's/\(.*\)/\L\1/' hi all # this also works: $ sed -e 's/\(.*\)/\L\1/' <<< "$a"