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
40
votes
7 answers

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

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…
ajt
  • 1,341
  • 3
  • 13
  • 30
38
votes
2 answers

Capitalize first letter of each word in a dataframe column

How do you capitalize the first letter of each word in a pandas dataframe column? For example, I am trying to make the following transformation. Column1 Column1 The apple The Apple the Pear ⟶ The Pear Green tea Green…
Jason Ching Yuk
  • 894
  • 2
  • 11
  • 30
36
votes
5 answers

How can I check if a letter in a string is capitalized using python?

I have a string like "asdfHRbySFss" and I want to go through it one character at a time and see which letters are capitalized. How can I do this in Python?
clayton33
  • 4,176
  • 10
  • 45
  • 64
36
votes
14 answers

Capitalize first letter of each word, in existing table

I have an existing table 'people_table', with a field full_name. Many records have the 'full_name' field populated with incorrect casing. e.g. 'fred Jones' or 'fred jones' or 'Fred jones'. I can find these errant entries with: SELECT * FROM…
SirRatty
  • 2,338
  • 5
  • 25
  • 37
35
votes
9 answers

How to capitalize the first word of the sentence 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…
wal
  • 2,044
  • 3
  • 18
  • 22
33
votes
2 answers

strtoupper PHP function for UTF-8 string

I've been reading user comments for the strtoupper() PHP function and there doesn't seem to a consensus on how to do the conversion for non-Enlgish strings. I mean people offer localized solutions and stuff, but shouldn't there be a uniform way to…
ahmd0
  • 16,633
  • 33
  • 137
  • 233
30
votes
11 answers

Notepad++: Capitalize first letter by Shortcut?

I've got a huge list of words (every single word in one line in a txt file) and certain words need to get capitalized manually (e.g. by hand), so I was looking if there's a shortcut in notepad++ (my editor currently) to automatically capitalize the…
tim
  • 9,896
  • 20
  • 81
  • 137
28
votes
4 answers

TextAllCaps in Text() widget of Flutter?

As we are having android:textAllCaps="true" feature in Android's Textview, how can we give this same feature in Text() Widget of Flutter? I know Text('Abc'.toUpperCase()), is one way but I don't want to do it manually. Is there any property of…
Gaurang Goda
  • 3,394
  • 4
  • 20
  • 29
26
votes
4 answers

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…
JW.
  • 50,691
  • 36
  • 115
  • 143
24
votes
9 answers

How to capitialize first letter of TextFormField in flutter

I'm trying to capitialize the first letter of Textformfield, for this i'm using the textCapitalization: TextCapitalization.words, but it's not working for Textformfield, and works for textfield please help how to do this.
TimeToCode
  • 1,458
  • 3
  • 18
  • 60
23
votes
10 answers

Capitalizing words in a string using C#

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…
Nir
  • 3,963
  • 8
  • 37
  • 51
23
votes
5 answers

How to make everything in a textfield be capital letters / uppercase?

I want to make everything I write in a textfield to be capital letters. As I write, not after losing focus. How do I do this using jQuery?
randomizertech
  • 2,309
  • 15
  • 48
  • 85
22
votes
6 answers

Did capitals ever matter in email addresses?

My dad says capitals used to matter (years ago) for email addresses but don't anymore. I'm fairly sure they never did because something like that involving DNS/MX changes would not change. Especially with no easy to find record online.
user588389
22
votes
5 answers

How do I capitalize the first letter of a word in Vim?

For a long time I've known that I can use ~ in Vim to toggle the case of a character. But is there a way to map a key to capitalize a word and go back to the previous position? For example: I like to drink Coca co[l] If my cursor is at "l" and I…
Patrick
  • 4,186
  • 9
  • 32
  • 45
20
votes
4 answers

Capitalization of Person names in programming

Is anyone aware of some code/rules on how to capitalize the names of people correctly? John Smith Johan van Rensburg Derrick von Gogh Ruby de La Fuente Peter Maclaurin Garry McDonald (these may not be correct, just some sample names and how the…
Albert
  • 1,062
  • 2
  • 13
  • 20
1
2
3
27 28