Questions tagged [capitalization]

Capitalization means changing each first letter of a string to a capital letter.

Capitalization means changing each first letter of all words in a string to capital letters. For example, "this is a test" would become "This Is A Test". In some programming languages, capitalization only makes the first letter of the string a capital, and not the first letter of each word.

412 questions
3
votes
3 answers

How to capitalize first letter of each line in bash?

I'm looking for a command that capitalizes the first letter of each line in bash. Actually I used this command: sed 's/^\(.\)/\U\1/' But I need to use another command instead of "\U". .
morkan
  • 171
  • 2
  • 3
  • 6
3
votes
5 answers

Javascript: Capitalization of each Word in String

Greetings, I want to capitalize each word in a script, for this I have came up with a such method: //Word Capitalization function wordToUpper(val) { newVal = ''; val = val.toLowerCase().split(' '); for(var c=0; c <…
Hellnar
  • 62,315
  • 79
  • 204
  • 279
3
votes
1 answer

Moving Oracle data (and index) to SQL-Server - capitalization in data

I'm trying to move data from an Oracle (10g) database to SQL-Server (2008). I also want the indexes to be re-created on the SQL-Server side. However, in Oracle, there is a primary key defined on the first two fields, and it has data like…
thursdaysgeek
  • 7,696
  • 20
  • 78
  • 115
3
votes
2 answers

Capitalise first letter of every sentence

How do I capitalise the first letter of every sentence in a string? Should I use .capitalisedString?
Tom Coomer
  • 6,227
  • 12
  • 45
  • 82
3
votes
2 answers

Separate first letter from String for capitalization

I want to take a String input form a user, and format it so that the first letter is capitalized and the rest is not. I would like to do this by splitting the first letter from the string and use .toUpperCase() on it and use .toLowerCase() on the…
Casper TL
  • 318
  • 4
  • 7
  • 16
3
votes
1 answer

Why is capitalized property name not giving an error in Objective-C / UITouch?

resultLabel is a UILabel. So why does resultLabel.Text= @""; not give an error? It should be resultLabel.text. Thanks for any insights.
Michael Rogers
  • 1,318
  • 9
  • 22
3
votes
1 answer

Get caret position in input to capitalize words on keyup while being able to edit the content

I decided to open a new question because I was trying to capitalize the first letter of words with 4 or more letters and with the exception of a few key words and I have this working code for that: http://jsfiddle.net/Q2tFx/11/ $.fn.capitalize =…
Santiago
  • 2,405
  • 6
  • 31
  • 43
3
votes
2 answers

PHP to capitalize all letters (including after a slash) except for certain words

I want to use PHP to clean up some titles by capitalizing each word, including those following a slash. However, I do not want to capitalize the words 'and', 'of', and 'the'. Here are two example strings: accounting technology/technician and…
Jon
  • 3,154
  • 13
  • 53
  • 96
3
votes
2 answers

text-transform: capitalize issue in IE

I am having problem with css property of text:transform. When I set it to capitalize, it behaves differently in IE7 and IE8. The Product title of page[1] shows apple tree 'Gala' in other browsers while in IE it shows apple tree 'gala' . Note the 'g'…
jimy
  • 4,848
  • 3
  • 35
  • 52
3
votes
1 answer

Caps only keypad

I have a bunch of EditTexts, and when the user clicks on these a keypad comes up and the user can enter some text. I want to make it so that the keypad is all in capital letters (i.e. caps lock permanently on). Is this possible?
Kurt
  • 767
  • 8
  • 23
3
votes
5 answers

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…
Leonard Ehrenfried
  • 1,573
  • 3
  • 20
  • 34
3
votes
1 answer

How do I change the capitalization of month names used by SimpleDateFormat?

This code: Locale brazil = new Locale("pt","BR"); SimpleDateFormat format = new SimpleDateFormat("d 'de' MMMM", brazil); Date date = new Date(); String result = format.format(date); System.out.println(result); outputs: 28 de Junho The problem is…
Adam
  • 43,763
  • 16
  • 104
  • 144
3
votes
3 answers

Proper capitalization of surnames in PHP

Possible Duplicate: Capitalization of Person names in programming I've noticed that people who are registering on my site are exceptionally lazy in the way that they don't even bother capitalizing their own names. My site is a business oriented…
Emphram Stavanger
  • 4,158
  • 9
  • 35
  • 63
2
votes
5 answers

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!
JD Isaacks
  • 56,088
  • 93
  • 276
  • 422
2
votes
2 answers

C++ std::string capitalize in non-latin language (without third-party libraries)

Considering the method: void Capitalize(std::string &s) { bool shouldCapitalize = true; for(size_t i = 0; i < s.size(); i++) { if (iswalpha(s[i]) && shouldCapitalize == true) { s[i] = (char)towupper(s[i]); …
Richard Topchii
  • 7,075
  • 8
  • 48
  • 115