capitalization

How should I capitalize Perl?

PERL? Perl? perl? What's good style? I know the answerI just wanted to make sure the question was out there and questioners were aware that there is a correct form. ...

c++ cout autocase strings?

Is it possible to do something like cout << "my string"; and have my string capitalized? from what i can tell there is no way to do it? i need to wrap it around a function ...

Correct Bash and shell script variable capitalization

I run across many shell scripts with variables in all caps, and I've always thought that there is a severe misunderstanding with that. My understanding is that, by convention (and perhaps by necessity long ago), environment variables are in all-caps. But in modern scripting environments like Bash, I have always prefered the convention ...

Flex: Capitalize words in string?

I am trying to do the equivalent of PHP's ucwords() in Flex. I dont want the whole string in uppercase just the first letter of each word. Does anyone know a way? Thanks! ...

Permutations of capitalization

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, H...

Capitalizing non-ASCII words in Python

How to capitalize words containing non-ASCII characters in Python? Is there a way to tune string's capitalize() method to do that? ...

Why is capitalising class names in Java (and others) only a suggestion and not a rule?

I am wondering why Java, with its many safety features and constraints, allows developers to start a class name with a lowercase letter even though it would be an extremely stupid idea to do so. Or have I overlooked a case where this could be useful? Or is it simply a case of not bossing the programmer around? ...

Capitalization Permutations

I wanted to write a snippet of ruby that would take a string and output all possible permutations of capitalizations. Basically, I have a password that I remember, but I don't remember how it is capitalized. I have the following so far: def permute(str) perms = Array.new (2 ** str.size).times { perms << str } perms.each_index d...

Capitalization convention for JavaScript objects

I know this question has no answer, but I'm curious to know what other people think. In a language like Java, it's a convention to begin classes with capital letters, and objects with lowercase letters. But what about JavaScript, where everything is an object? I've seen some people suggest capitalizing only objects that are treated as ...

SOLR - wildcard search with capital letter

I have a problem with SOLR searching. When i`am searching query: dog* everything is ok, but when query is Dog*(with first capital letter), i get no results. Any advice? My config: <fieldType name="text" class="solr.TextField" positionIncrementGap="100"> <analyzer type="index"> <tokenizer class="solr.WhitespaceTokenizerFactory"/> ...

Capitalize First Char of Each Word in a String Java

Is there a function built into Java that capitalizes the first character of each word in a String, and does not affect the others? Examples: jon skeet -> Jon Skeet miles o'Brien -> Miles O'Brien (B remains capital, this rules out Title Case) old mcdonald -> Old Mcdonald* *(Old McDonald would be find too, but I don't expect it to be ...

Why does Perl's Text::Capitalize turn "Juvénal" into "JuvéNal"?

I'm using Text::Capitalize to try and title case some UTF-8 encoded names from a web page (downloaded using WWW::Mechanize, but I'm not getting the results I'm expecting. For example, the name on web page is "KAJELIJELI, Juvénal" but capitalize_title returns "Kajelijeli, JuvéNal" (notice the uppercase N). I've tried use utf8; and chang...

Capitalize first letter of text field WHILE typing with Jquery?

I'm looking for an example of how to capitalize the first letter of a string being entered into a text field. Normally, this is done on the entire field with a function or regex onBlur or OnChange, etc... I want to capitalize the first letter while the user is STILL typing. For instance, if I'm typing the word "cat" -- The user should...

Force all capitals in NSTextField (Cocoa)

Hi, Is there a way to force capitals in a NSTextField? I want to create a text field for typing in Post Codes, and I want all post codes entered to use capital letters. e.g. N1 3ET instead of: n1 3et Also, I am using a regular expression, which only accepts capitals (I know very little about regular expressions, so I'm not keen on mod...

Need help with hard regex

I need a regex that checks if a string only contain letters(a-z) and that the first letter is uppercase, you cant have 2 letters in a word uppercase Like: THomas or THomAS but Thomas Anderson (Thomas anderson too) would be valid look: The Magician Of The Elfs would be valid but not ThE MaGiCiAN oF ThE ELFS if (!preg_match("??", $name)...

Check if a string is all-caps in Emacs lisp?

Hi, all. I was wondering if Emacs lisp had a built-in function for checking if a string is made entirely out of capitalized characters. Here is what I'm using right now: (setq capital-letters (string-to-list "ABCDEFGHIJKLMNOPQRSTUVWXYZ")) (defun chars-are-capitalized (list-of-characters) "Returns true if every character in a list of ...

[Iphone Dev] Change the first character in each word of a string to uppercase

Hey guys, I found the function below : CFStringCapitalize "Changes the first character in each word of a string to uppercase (if it is a lowercase alphabetical character)." void CFStringCapitalize ( CFMutableStringRef theString, CFLocaleRef locale ); Does anyone know how to use it with my NSMutableString ? Thank you, Gaut...

Case Sensitivity In Perl Script - How Do I Make It Insensitive?

How would I change the following markov script to treat capitalized and lowercase words as the same? The entire idea is to help increase the quality of output of my markov text generator. As it stands, if you plug 99 lowercase sentences into it and 1 capitalized sentence - you almost always find a non-markovized version of the capitali...

Capitalizing texts in user interface

Hi there, I'd like to ask you if there is a reason to capitalize all items in menus, etc in application user interface, for example File->Page Setup Edit->Select All Help->Technical Support Why shouldn't I just label these items as File->Page setup etc.? This kind of capitalization just seems wrong to me - but I am not a native En...

How to capitalize the first word of the sentece in Objective C?

I've already found how to capitalize all words of the sentence, but not the first word only. NSString *txt =@"hi my friends!" [txt capitalizedString]; I don't want to change to lower case and capitalize the first char. I'd like to capitalize the first word only without change the others. ...