Questions tagged [capitalize]

Capitalize is writing a word with its first letter as a capital letter (upper-case letter) and the remaining letters in lower case.

Capitalize is writing a word with its first letter as a capital letter (upper-case letter) and the remaining letters in lower case.

Mark the questions with this tag if it concerns automatic capitalization of strings.

If question is related to make the whole string upper-case, use tag .

321 questions
31
votes
6 answers

Why Css text-transform capitalize not working?

I have an example text and it all Uppercase. I want to make it capitalized text, but css text-transform doesn't work. How can i do this? span, a, h2 { text-transform: capitalize !important; }
wpuzman
  • 343
  • 1
  • 3
  • 9
30
votes
1 answer

text-transform: capitalize; Also affects Placeholder

I have the following simple input. When I use text-transform: capitalize; to capitalize the first letter of each word, the placeholder also gets capitalized: What Is Your Username? How can…
Ali Bassam
  • 9,691
  • 23
  • 67
  • 117
30
votes
2 answers

Capitalise first letter in String

I'm having trouble converting the first letter to Capital in a String: rackingSystem.toLowerCase(); // has capitals in every word, so first convert all to lower case StringBuilder rackingSystemSb = new…
Scamparelli
  • 756
  • 1
  • 12
  • 28
27
votes
8 answers

Make String first letter capital in java

As of now I'm using this code to make my first letter in a string capital String output = input.substring(0, 1).toUpperCase() + input.substring(1); This seems very dirty to me ..is there any direct or elegant way..
Suresh Atta
  • 120,458
  • 37
  • 198
  • 307
26
votes
4 answers

Lower case all then capitalize - pure CSS

I saw this topic here: First lowercase the text then capitalize it. Is it possible with CSS? But it wasn't pure CSS. I have a div that contains this text:
RaWr rAwR
I want to use css to make it look like "Rawr Rawr". Cut if I just to…
Noitidart
  • 35,443
  • 37
  • 154
  • 323
22
votes
3 answers

python capitalize() on a string starting with space

I was using the capitalize method on some strings in Python and one of strings starts with a space: phrase = ' Lexical Semantics' phrase.capitalize() returns ' lexical semantics' all in lower case. Why is that?
NLPer
  • 511
  • 1
  • 4
  • 9
17
votes
5 answers

Ruby - remove underscores and capitalize

Okay so I'm trying to remove the underscores, as seen in some of the holidays (for example,fourth_of_july). Then I want to capitalize each of the words. Expected result: fourth_of_july > Fourth Of July so this is my code: holiday_dec = { :winter =>…
Jun
  • 173
  • 1
  • 1
  • 4
16
votes
2 answers

Why does pylint require capitalized variable names when outside a function?

Why does pylint accept capitalized variables when outside a function and reject them inside a function? Conversely, why does pylint reject camelCase ouside a function and accept it inside a function? I just installed pylint (version 2.2.2) to check…
dputhier
  • 734
  • 1
  • 7
  • 23
15
votes
8 answers

Python How to capitalize nth letter of a string

I tried this: Capitalize a string. Can anybody provide a simple script/snippet for guideline? Python documentation has capitalize() function which makes first letter capital. I want something like make_nth_letter_cap(str, n).
Trojosh
  • 565
  • 1
  • 5
  • 15
13
votes
2 answers

Capitalize selection in Sublime Text

Is there a way to capitalize a selection in Sublime? For example, if I have some text like word, I'd like the output to be Word. I know that there is already an option to convert case into lower case or upper case, but those would result in word…
Saad
  • 49,729
  • 21
  • 73
  • 112
13
votes
6 answers

How to capitalize first line with CSS? ::first-line pseudo-element not working

Right now I've got a paragraph and I'd like to capitalize the entire first line. I've set the first paragraph to an ID "firstp" and tried: #firstp::first-line { text-transform: uppercase; } I've tried it with text-transform: capitalize but that…
user1390754
  • 171
  • 1
  • 1
  • 10
11
votes
2 answers

Capitalize first letter ONLY of a string in Python

I'm trying to write a single line statement that assigns the value of a string to a variable after having ONLY the first letter capitalized, and all other letters left unchanged. Example, if the string being used were: myString =…
Oliver Vakomies
  • 133
  • 1
  • 1
  • 4
11
votes
3 answers

Automatically capitalize first letter of first word in a new sentence in LaTeX

I know one of LaTeX's bragging points is that it doesn't have this Microsoftish behavior. Nevertheless, it's sometimes useful. LaTeX already adds an extra space after you type a (non-backslashed) period, so it should be possible to make it…
memius
  • 4,045
  • 5
  • 26
  • 25
8
votes
3 answers

using capitalize on a collection_select

If this has been answered before I cannot find it. I have the following: = f.collection_select :sex_id, @sexes, :id, :name and this in the controller: @sexes = Sex.all the sexes are all stored in lowercase, like this: id|name 1|steer 2|heifer …
Toby Joiner
  • 4,306
  • 7
  • 32
  • 47
8
votes
3 answers

Capitalize the first letter of a string without touching the others

I'm wanting to capitalize the fist letter of a string but leave the rest What I have: racEcar What I want: RacEcar
Resse Jeid
  • 121
  • 1
  • 3
1
2
3
21 22