angularjs force uppercase in textbox

Please see the other answer below, which is superior to this one. this answer is based on the answer here: How to autocapitalize the first character in an input field in AngularJS?. I’d imagine that what you’d want would be a parser function like this: angular .module(‘myApp’, []) .directive(‘capitalize’, function() { return { require: ‘ngModel’, … Read more

Use Java and RegEx to convert casing in a string

You can’t do this in Java regex. You’d have to manually post-process using String.toUpperCase() and toLowerCase() instead. Here’s an example of how you use regex to find and capitalize words of length at least 3 in a sentence String text = “no way oh my god it cannot be”; Matcher m = Pattern.compile(“\\b\\w{3,}\\b”).matcher(text); StringBuilder sb … Read more

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

upper-case() and lower-case() are XPath 2.0 functions. Chances are your platform supports XPath 1.0 only. Try: translate(‘some text’,’abcdefghijklmnopqrstuvwxyz’,’ABCDEFGHIJKLMNOPQRSTUVWXYZ’) which is the XPath 1.0 way to do it. Unfortunately, this requires knowledge of the alphabet the text uses. For plain English, the above probably works, but if you expect accented characters, make sure you add them … Read more

In Android EditText, how to force writing uppercase?

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 ones. InputFilter[] editFilters = <EditText>.getFilters(); InputFilter[] newFilters = new InputFilter[editFilters.length + 1]; System.arraycopy(editFilters, 0, newFilters, 0, … Read more