Capitalize or change case of an NSString in Objective-C

Here ya go: viewNoteDateMonth.text = [[displayDate objectAtIndex:2] uppercaseString]; Btw: “april” is lowercase ➔ [NSString lowercaseString] “APRIL” is UPPERCASE ➔ [NSString uppercaseString] “April May” is Capitalized/Word Caps ➔ [NSString capitalizedString] “April may” is Sentence caps ➔ (method missing; see workaround below) Hence what you want is called “uppercase“, not “capitalized“. 😉 As for “Sentence Caps” one … Read more

Capitalize the first letter of string in AngularJs

use this capitalize filter var app = angular.module(‘app’, []); app.controller(‘Ctrl’, function ($scope) { $scope.msg = ‘hello, world.’; }); app.filter(‘capitalize’, function() { return function(input) { return (angular.isString(input) && input.length > 0) ? input.charAt(0).toUpperCase() + input.substr(1).toLowerCase() : input; } }); <script src=”https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js”></script> <div ng-app=”app”> <div ng-controller=”Ctrl”> <p><b>My Text:</b> {{msg | capitalize}}</p> </div> </div>

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

How to convert a string to lower or upper case in Ruby

Ruby has a few methods for changing the case of strings. To convert to lowercase, use downcase: “hello James!”.downcase #=> “hello james!” Similarly, upcase capitalizes every letter and capitalize capitalizes the first letter of the string but lowercases the rest: “hello James!”.upcase #=> “HELLO JAMES!” “hello James!”.capitalize #=> “Hello james!” “hello James!”.titleize #=> “Hello James!” … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)