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
5
votes
4 answers

How to capitalize the first letter of a string

I have a string like this var sentence string = "the biggest ocean is the Pacific ocean" I want to be able to capitalize the first letter t in the input string, so that the string becomes "The biggest ocean is the Pacific ocean" How to do that in…
Ineedanswers
  • 71
  • 1
  • 4
5
votes
1 answer

Perl: How can I capitalize a regex match?

I am using this regular expression to find patterns in a genome. $string =~ /(?i)a+t?|(?i)t+/g To make the output easier to read I would like to modify it so it capitalizes anything it matches that is 4 to 7 characters long. Also it should not mess…
Orion
  • 207
  • 2
  • 9
5
votes
3 answers

Convert string to title case after dash or slash

I use this common function to convert most of my list items to title case with no issues. I've discovered one place that needs improvement, when there is a dash or slash in the middle, I want the next letter capitalized. For example Hispanic/latino…
Connie DeCinko
  • 996
  • 5
  • 19
  • 39
5
votes
0 answers

Why is System.Math.PI in all caps (or a public field)?

In .Net 4.5, System.Math.PI is written as such, in all caps. Microsoft's own Capitalization Conventions state that Pascal casing is to be used for all public members. Also, their conventions on Names of Type Members mention that all public static…
Bas
  • 1,946
  • 21
  • 38
5
votes
6 answers

How to set initial caps in VIM?

In VIM, it's really easy to change a word of text to use uppercase or lowercase: # in visual mode # change word to uppercase gUw # change word to lowercase guw Is there a simple way to modify the word to use initial caps?
MCS
  • 22,113
  • 20
  • 62
  • 76
5
votes
2 answers

Does capitalization matter in MySQL?

I can't find a reference about which part of a MySQL query is case sensitive. Is there an overview of where capitalization matters? Specifically, are any of these case sensitive: database name table name column name Is it tied to the OS?…
Tyler DeWitt
  • 23,366
  • 38
  • 119
  • 196
5
votes
3 answers

Why did some very likely PEP8 aware developers capitalize their package names? (examples: Django, Sphinx, Fabric, ... )

PEP8 advises that module and package names have all-lowercase names. The majority of packages on PyPI seem to follow this rule. Yet there are some packages of clearly very capable and PEP8-aware developers that have capitalized their package…
Bentley4
  • 10,678
  • 25
  • 83
  • 134
5
votes
2 answers

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?
Alex
  • 43,191
  • 44
  • 96
  • 127
4
votes
4 answers

Is there an 'official' convention on whether SQL functions should be capitalized?

I read a bunch of the articles a questions asking about capitalizing SQL keywords (SELECT, FROM, WHERE, etc.), but I couldn't find a thread for the following: Should I capitalize SQL functions, like SUM(), COUNT(), etc.? The teacher of a class I…
Leon S
  • 153
  • 1
  • 13
4
votes
2 answers

iOS TextField AutoCapitalization not working

I have created a new project that only has one text field and I set the capitalization to all characters. I tried this from both interface builder and code: [self.textField setAutocapitalizationType:UITextAutocapitalizationTypeAllCharacters]; No…
Dog
  • 474
  • 8
  • 25
4
votes
2 answers

Python - Join Two List Object Eachother If Their First Name Uppercase

Is it possible to group Uppercased words which are sequential ? For example i have a list like that: lst =[['John'],['is'],['smart'],[','],['John'],['Kenneddy'],['is'],['smarter'],[','],['John'],['Fitzgerald'],['Kennedy'],['is'],['best']] Desired…
Arda Nalbant
  • 479
  • 2
  • 7
  • 16
4
votes
4 answers

How to capitalize first letter of every word using sed in OSX

I'm trying to capitalize the first letter of every word in a string using the following sed command, but it's not working: echo "my string" | sed 's/\b\(.\)/\u\1/g' Output: my string What am I doing wrong? Thank you
Ares
  • 1,411
  • 1
  • 19
  • 35
4
votes
1 answer

Target sequences of 2 and more capital letters

I'm a graphic designer in a magazine and we'd like our website to be closer to our printed issues. In the magazine, we use small caps for strings of more than 2 capital letters in a row. I know it is possible to use true small caps with an OpenType…
4
votes
5 answers

lowercase + capitalize + concatenate words of a string in shell (e.g. bash)

How to capitalize+concatenate words of a string? (first letter uppercase and all other other letters lowercase) example: input = "jAMeS bOnD" output = "JamesBond"
oHo
  • 51,447
  • 27
  • 165
  • 200
4
votes
1 answer

Proper title case in ICU [Does ICU have a list of non-capitalized words?]

Is it possible to obtain proper capitalization for e.g. English text using ICU4C but without building any custom set of non-capitalized words? Say, given pining for the fjords I'd like to obtain Pining for the Fjords. With ucasemap_utf8ToTitle() and…
gagolews
  • 12,836
  • 2
  • 50
  • 75