uppercase

Capitalize the first letter of string in AngularJs

风流意气都作罢 提交于 2019-11-28 16:35:51
I want capitalize first character of string in angularjs As i used {{ uppercase_expression | uppercase}} it convert whole string to upper case. 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

Python title() with apostrophes

﹥>﹥吖頭↗ 提交于 2019-11-28 10:40:13
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" ? 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 collapsing issue by specifying " " in the sep argument: >>> string.capwords("john's school", " ") "John's School

How can I convert Unicode to uppercase to print it?

混江龙づ霸主 提交于 2019-11-28 10:40:02
I have this: >>> print 'example' example >>> print 'exámple' exámple >>> print 'exámple'.upper() EXáMPLE What I need to do to print: EXÁMPLE (Where the 'a' gets its accute accent, but in uppercase.) I'm using Python 2.6. I think it's as simple as not converting to ASCII first. >>> print u'exámple'.upper() EXÁMPLE In python 2.x, just convert the string to unicode before calling upper(). Using your code, which is in utf-8 format on this webpage: >>> s = 'exámple' >>> s 'ex\xc3\xa1mple' # my terminal is not utf8. c3a1 is the UTF-8 hex for á >>> s.decode('utf-8').upper() u'EX\xc1MPLE' # c1 is the

Is it possible to replace to uppercase in Visual Studio?

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-28 09:38:53
Is it possible to replace to upper case in Visual Studio using "Find and Replace" dialog and RegEx (?) à la: . => Upper(.) ? Say I have: m_<b>a</b>blabla I want: _<b>A</b>blabla RickL You can solve this by using Visual Studio temporary macros. This is a very powerful, flexible feature which I use all the time for performing repetitive code manipulations. I'm assuming you're using the C# default key bindings here. Press CTRL + SHIFT + F to bring up the find in files dialogue. Click use "Regular expressions" Set "Find what:" to " <m_:Ll " - words that begin with m, underscore, then a lower case

Make input value uppercase in CSS without affecting the placeholder

不羁岁月 提交于 2019-11-28 08:52:15
Is there a way I can make an input value uppercase without making the placeholder uppercase? Seems like I get one or the other. I'd prefer to do this cleanly just using CSS (JS last resort). Each browser engine has a different implementation to control placeholder styling. Use the following: jsBin example. input { text-transform: uppercase; } ::-webkit-input-placeholder { /* WebKit browsers */ text-transform: none; } :-moz-placeholder { /* Mozilla Firefox 4 to 18 */ text-transform: none; } ::-moz-placeholder { /* Mozilla Firefox 19+ */ text-transform: none; } :-ms-input-placeholder { /*

Turkish case conversion in JavaScript

对着背影说爱祢 提交于 2019-11-28 05:49:31
I want to convert strings to lower or upper case in JavaScript in the locale I wanted. I think standard functions like toUpperCase() and toLocaleUpperCase() do not satisfy this need. toLocale functions do not behave as they should. For example, in Safari 4, Chrome 4 Beta, Firefox 3.5.x on my system it converts strings with Turkish characters incorrectly. The browsers respond to navigator.language as "en-US" , "tr" , "en-US" respectively. But there is no way to get user's Accept-Lang setting in the browser as far as I could found. Only Chrome gives me "tr" although I have configured every

How to convert input char to uppercase automatically in Java

倖福魔咒の 提交于 2019-11-28 05:24:26
问题 I am using a Scanner class to get the input and want to convert the input to uppercase letter when display it. This is my code Scanner input = new Scanner(System.in); System.out.print("Enter a letter: "); char c = input.next().charAt(0); Character.toUpperCase(c); Since I have convert it to uppercase, but the output is like input: a c = A; output: Enter a letter: a PS: The letter "a" is what I typed in the terminal However I want to it display as an uppercase one. How can I change it? 回答1: The

Capitalize or change case of an NSString in Objective-C

独自空忆成欢 提交于 2019-11-28 02:51:59
I was wondering how to capitalize a string found in an object in an NSMutableArray . An NSArray contains the string 'April' at index 2. I want this to be changed to 'APRIL' . Is there something simple like this? viewNoteDateMonth.text = [[displayDate objectAtIndex:2] capitalized]; 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

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

两盒软妹~` 提交于 2019-11-28 02:32:56
How do I take a string and convert it to lower or upper case in Ruby? Sophie Alpert 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!" If you want to modify a string in place, you can add an exclamation point to any of those methods: string = "hello James!

How to find values in all caps in SQL Server?

时光怂恿深爱的人放手 提交于 2019-11-27 17:09:28
问题 How can I find column values that are in all caps? Like LastName = 'SMITH' instead of 'Smith' Here is what I was trying... SELECT * FROM MyTable WHERE FirstName = UPPER(FirstName) 回答1: You can force case sensitive collation; select * from T where fld = upper(fld) collate SQL_Latin1_General_CP1_CS_AS 回答2: Try SELECT * FROM MyTable WHERE FirstName = UPPER(FirstName) COLLATE SQL_Latin1_General_CP1_CS_AS This collation allows case sensitive comparisons. If you want to change the collation of your