lowercase

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

天大地大妈咪最大 提交于 2019-11-26 16:32:48
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. upper-case() and lower-case() are XPath 2.0 functions. Chances are your platform supports XPath 1.0 only. Try: translate('some text','abcdefghijklmnopqrstuvwxyz',

How to rename all folders and files to lowercase on Linux?

守給你的承諾、 提交于 2019-11-26 15:35:24
I have to rename a complete folder tree recursively so that no uppercase letter appears anywhere (it's C++ sourcecode, but that shouldn't matter). Bonus points for ignoring CVS and SVN control files/folders. Preferred way would be a shell script, since shell should be available at any Linux box. There were some valid arguments about details of the file renaming. I think files with same lowercase names should be overwritten, it's the user's problem. When checked out on a case-ignoring file system would overwrite the first one with the latter, too. I would consider A-Z characters and transform

How to convert array values to lowercase in PHP?

◇◆丶佛笑我妖孽 提交于 2019-11-26 11:57:16
问题 How can I convert all values in an array to lowercase in PHP? Something like array_change_key_case ? 回答1: use array_map(): $yourArray = array_map('strtolower', $yourArray); 回答2: Just for completeness: you may also use array_walk: array_walk($yourArray, function(&$value) { $value = strtolower($value); }); From PHP docs: If callback needs to be working with the actual values of the array, specify the first parameter of callback as a reference. Then, any changes made to those elements will be

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,

How do I lowercase a string in C?

匆匆过客 提交于 2019-11-26 07:27:56
问题 How can I convert a mixed case string to a lowercase string in C? 回答1: It's in the standard library, and that's the most straight forward way I can see to implement such a function. So yes, just loop through the string and convert each character to lowercase. Something trivial like this: #include <ctype.h> for(int i = 0; str[i]; i++){ str[i] = tolower(str[i]); } or if you prefer one liners, then you can use this one by J.F. Sebastian: for ( ; *p; ++p) *p = tolower(*p); 回答2: to convert to

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.

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"

How to capitalize the first character of each word in a string

懵懂的女人 提交于 2019-11-25 22:27:44
问题 Is there a function built into Java that capitalizes the first character of each word in a String, and does not affect the others? Examples: jon skeet -> Jon Skeet miles o\'Brien -> Miles O\'Brien (B remains capital, this rules out Title Case) old mcdonald -> Old Mcdonald * *( Old McDonald would be find too, but I don\'t expect it to be THAT smart.) A quick look at the Java String Documentation reveals only toUpperCase() and toLowerCase() , which of course do not provide the desired behavior.