capitalize

I'm tyring to use a script to undo ALL CAPS in my text area

混江龙づ霸主 提交于 2019-12-11 20:29:46
问题 I have a textarea that receives inputs in ALL CAPS, which is fine for most users. Some users need the text represented in a normalized fasion - with the first letter of each sentence capitalized and the rest lowercase. I tried to adapt some suggestions from other SO threads, but somethings is missing. Help please! Body <form> <input value="Select all" onclick="javascript:this.form.finaltext.focus();this.form.finaltext.select();" type="button"> <input value="Clear All" onclick="this.form

is there a string method to capitalize acronyms in python?

半腔热情 提交于 2019-12-11 16:12:56
问题 This is good: import string string.capwords("proper name") 'Proper Name' This is not so good: string.capwords("I.R.S") 'I.r.s' Is there no string method to do capwords so that it accomodates acronyms? 回答1: This might work: import re def _callback(match): """ This is a simple callback function for the regular expression which is in charge of doing the actual capitalization. It is designed to only capitalize words which aren't fully uppercased (like acronyms). """ word = match.group(0) if word

Why does entity framework pluralize and capitalize entity class names?

丶灬走出姿态 提交于 2019-12-11 14:22:08
问题 Why does entity framework pluralize all the class names and capitalize the first letters by default? What are the advantages of doing this ? Probably a stupid question...but just out of curiosity? 回答1: In the Capitalization Conventions section of the .NET Design Guidelines for Developing Class Libraries, it states that all class names should be in Pascal case, which it defines as: "The first letter in the identifier and the first letter of each subsequent concatenated word are capitalized.

Capitalization of each sentence in a string in Python 3

*爱你&永不变心* 提交于 2019-12-11 09:36:04
问题 This should be easy but somehow I'm not quite getting it. My assignment is: Write a function sentenceCapitalizer that has one parameter of type string. The function returns a copy of the string with the first character of each sentence capitalized. The function should return “Hello. My name is Joe. What is your name?” if the argument to the function is “hello. my name is Joe. what is your name?” Assume a sentence is separated by a period followed by a space." What I have so far is: def

How do I make letters to uppercase after each of a set of specific characters

北城余情 提交于 2019-12-11 02:46:19
问题 I have a collection of characters (',', '.', '/', '-', ' ') then I have a collection of strings (about 500). What I want to do as fast as possible is: after each of the characters I want to make the next letter uppercase. I want the first capitalized as well and many of the strings are all uppercase to begin with. EDIT: I modified tdragons answer to this final result: public static String CapitalizeAndStuff(string startingString) { startingString = startingString.ToLower(); char[] chars = new

PHP - Capitalise first character of each word expect certain words

做~自己de王妃 提交于 2019-12-11 00:31:56
问题 I have a batch of strings like so: tHe iPad hAS gONE ouT of STOCK PoWER uP YOur iPhone wHAT moDEL is YOUR aPPLE iPHOne I want to capitalise the first character of each word and have the remaining characters lowercase - except any references of iPhone or iPad . As in: By using: ucwords(strtolower($string)); This can do most of what is needed but obviously also does it on iPad and iPhone : The Ipad Has Gone Out Of Stock Power Up Your Iphone What Model Is Your Apple Iphone How can I do achieve

how to CaPiTaLiZe every other character in php?

半世苍凉 提交于 2019-12-10 10:04:44
问题 I want to CaPiTaLiZe $string in php, don't ask why :D I made some research and found good answers here, they really helped me. But, in my case I want to start capitalizing every odd character (1,2,3...) in EVERY word. For example, with my custom function i'm getting this result "TeSt eXaMpLe" and want to getting this "TeSt ExAmPlE". See that in second example word "example" starts with capital "E"? So, can anyone help me? : ) 回答1: Here's a one liner that should work. preg_replace('/(\w)(.)?/e

Capitalize first letter of TextView in an Android layout xml file

痴心易碎 提交于 2019-12-09 18:50:53
问题 I have a TextView in a layout xml file like this: <TextView android:id="@+id/viewId" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/string_id" /> My string is specified like this: <string name="string_id">text</string> Is it possible to make it display "Text" instead of "text" without java code ? (and without changing the string itself either) 回答1: No. But you can create a simple CustomView extending TextView that overrides setText and

text-transform: capitalize; Also affects Placeholder

社会主义新天地 提交于 2019-12-09 07:44:50
问题 I have the following simple input. <input type="text" placeholder="What is your username?" /> When I use text-transform: capitalize; to capitalize the first letter of each word, the placeholder also gets capitalized: What Is Your Username? How can I keep the placeholder intact? 回答1: You could style the placeholder-- ::-webkit-input-placeholder { text-transform: initial; } :-moz-placeholder { text-transform: initial; } ::-moz-placeholder { text-transform: initial; } :-ms-input-placeholder {

How to capitalize first line with CSS? ::first-line pseudo-element not working

不打扰是莪最后的温柔 提交于 2019-12-08 16:03:14
问题 Right now I've got a paragraph and I'd like to capitalize the entire first line. I've set the first paragraph to an ID "firstp" and tried: #firstp::first-line { text-transform: uppercase; } I've tried it with text-transform: capitalize but that doesn't work either. It's strange because I've managed to change the first letter (changed font size) using #firstp:first-letter . 回答1: text-transform on :first-line is really buggy right now, see the reference here http://reference.sitepoint.com/css