capitalization

Is there a way to style a TextView to uppercase all of its letters?

百般思念 提交于 2019-11-28 15:34:17
问题 I would like to be able to assign a xml attribute or style to a TextView that will make whatever text it has in ALL CAPITAL LETTERS. The attributes android:inputType="textCapCharacters" and android:capitalize="characters" do nothing and look like they are for user inputed text, not a TextView . I would like to do this so I can separate the style from the content. I know I could do this programmically but again I want keep style out of the content and the code. 回答1: I though that was a pretty

Permutations of capitalization

百般思念 提交于 2019-11-28 09:30:13
问题 I want to build a list containing every possible permutation of capitalization of a word. so it would be List<string> permutate(string word) { List<string> ret = new List<string>(); MAGIC HAPPENS HERE return ret; } So say I put in "happy" I should get an array back of {happy, Happy, hAppy, HAppy, haPpy, HaPpy ... haPPY, HaPPY, hAPPY, HAPPY} I know of plenty of functions that will capitalize the first letter but how do I do any arbitrary letter in the word? 回答1: You can modify individual

How should I capitalize Ruby? [closed]

被刻印的时光 ゝ 提交于 2019-11-28 01:55:01
RUBY? Ruby? ruby? What's good style? I know the answer—I just wanted to make sure the question was out there and questioners were aware that there is a correct form. Also, should I capitalize "gem" as "GEM"? class TestLanguageName < Test::Unit::TestCase def test_language_name assert_correct_language_name StackOverflow.new.describe_language("RuBy") end end class StackOverflow def describe_language(string) # Which of the following? methods = [:upcase, :capitalize, :downcase] string.send(methods[rand(3)]) end end Section 1.9 of ruby-doc.org FAQ says: Officially, the language is called "Ruby". On

Using a regular expression to replace upper case repeated letters in python with a single lowercase letter

对着背影说爱祢 提交于 2019-11-27 21:54:09
I am trying to replace any instances of uppercase letters that repeat themselves twice in a string with a single instance of that letter in a lower case. I am using the following regular expression and it is able to match the repeated upper case letters, but I am unsure as how to make the letter that is being replaced lower case. import re s = 'start TT end' re.sub(r'([A-Z]){2}', r"\1", s) >>> 'start T end' How can I make the "\1" lower case? Should I not be using a regular expression to do this? jensgram Pass a function as the repl argument. The MatchObject is passed to this function and

Capitalizing words in a string using c#

大憨熊 提交于 2019-11-27 17:22:01
问题 I need to take a string, and capitalize words in it. Certain words ("in", "at", etc.), are not capitalized and are changed to lower case if encountered. The first word should always be capitalized. Last names like "McFly" are not in the current scope so the same rule will apply to them - only first letter capitalized. For example: "of mice and men By CNN" should be changed to "Of Mice and Men by CNN". ( Therefore ToTitleString won't work here ) I'm wondering what would be the best way to do

PostgreSQL procedural language “C” not found

淺唱寂寞╮ 提交于 2019-11-27 16:08:23
I am trying to use the PL/R procedural language in a PostgreSQL 9.2 database. I have installed the plr language and I am trying to add it to a database. When I run the command CREATE EXTENSION plr; I get the following error: ERROR: language "C" does not exist STATEMENT: CREATE EXTENSION plr; ERROR: language "C" does not exist When I list the available languages in the database with select * from pg_language; I get lanname | lanowner | lanispl | lanpltrusted | lanplcallfoid | laninline | lanvalidator | lanacl ----------+----------+---------+--------------+---------------+-----------+-----------

Capitalize first letter of sentences CSS

▼魔方 西西 提交于 2019-11-27 13:52:18
I want to capitalize the first letter of sentences, and also the first letter after commas if possible. I want to add the code in here: .qcont { width: 550px; height: auto; float: right; overflow: hidden; position: relative; } LuudJacobs You can capitalize the first letter of the .qcont element by using the pseudo-element :first-letter . .qcont:first-letter{ text-transform: capitalize } This is the closest you're gonna get using only css. You could use javascript (in combination with jQuery) to wrap each letter which comes after a period (or comma, like you wish) in a span . You could add the

Is there a good reason to use upper case for SQL keywords? [closed]

社会主义新天地 提交于 2019-11-27 10:49:31
The default seems to be upper case, but is there really any reason to use upper case for keywords? I started using upper case because I was just trying to match what SQL Server gives me whenever I tried to create something, like a new stored procedure. But then, I felt terrible for my baby (5th) finger, that always needs to hold down the Shift button, so I stopped using upper case. Any reason why I should go back to upper case? Edit : Thanks for the answers guys. I wasn't programming yet back in the days when COBOL was king, so I wasn't aware of this. I'll stick with lower case from now on. It

How should I capitalize Perl? [closed]

我只是一个虾纸丫 提交于 2019-11-27 09:26:52
PERL? Perl? perl? What's good style? I know the answer—I just wanted to make sure the question was out there and questioners were aware that there is a correct form. The correct casing is "Perl" for the language and "perl" for the executable. Using "PERL" flags you as someone who isn't particularly familiar with the language or community. See also What's the difference between "perl" and "Perl"? in perlfaq1 . chakrit Quoting the Perl article on Wikipedia . The name is normally capitalized (Perl) when referring to the language and uncapitalized (perl) when referring to the interpreter program

Why is the 't' in Hash Table(Hashtable) in Java not capitalized [closed]

心已入冬 提交于 2019-11-27 03:28:44
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 7 years ago . Everything in Java seems to follow capitalization rules except for Hashtable. Hashtable<String, String> ht = new Hashtable<String, String>(); as opposed to ArrayList<String> a = new ArrayList<String>(); or HashMap<String,Integer> a = new HashMap<String,Integer>(); Why is this ? Is Hash Table read as just one