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

Decapitalize human names (accounting for ' and -)

I've got a vector of (human) names, all in capitals: names <- c("FRIEDRICH SCHILLER", "FRANK O'HARA", "HANS-CHRISTIAN ANDERSEN") To decapitalize (capitalize the first letters only) so far, I was using simpleDecap <- function(x) { s <- strsplit(x,…
MERose
  • 4,048
  • 7
  • 53
  • 79
5
votes
3 answers

How to capitalize a word in a C++ string?

I have a std::string and wish for the first letter to be capitalized and the rest lower case. One way I could do this is: const std::string example("eXamPLe"); std::string capitalized = boost::to_lower_copy(example); capitalized[0] =…
WilliamKF
  • 41,123
  • 68
  • 193
  • 295
5
votes
4 answers

Programmatically switch keyboard from uppercase to lowercase

I would like to turn my user's keyboard from uppercase to lowercase to force typing in lower-case. How can I do this?
Albert Renshaw
  • 17,282
  • 18
  • 107
  • 195
5
votes
6 answers

Capitalize words in title page until hyphen

This is the title of my page: john smith - Site and site - jobs I have to capitalize the title of the page until the first hifen (-). This is my code, but lost the second part and the first hyphen. function toTitleCase(str){ var…
roybatty
  • 191
  • 3
  • 13
4
votes
7 answers

Android EditText Capital Characters

I have an edittext and I want any character that I type in edittext show in Capital letter. I have used this: edittext.setInputType(InputType.TYPE_TEXT_FLAG_CAP_CHARACTERS); But it is not working. I want to do it dynamically. Any ideas.
rizzz86
  • 3,862
  • 8
  • 35
  • 52
4
votes
2 answers

select tag in Google Chrome shows lowercase options

In Google Chrome, I have a select tag with countries which render with lowercase first letters when viewed in the browser. In all other browsers, they have upper case letters. The option labels are rendered with lowercase first letters, but we…
JustBeingHelpful
  • 18,332
  • 38
  • 160
  • 245
4
votes
3 answers

Apply .capitalize on an Cyrillic array in ruby

I want to capitalise the string elements in the array with ruby This is my code: headermonths = ["января","февраля","марта","апреля","мая","июня","июля","августа","октября","ноября","декабря"] headermonths.each {|month| month.capitalize!} puts…
4
votes
5 answers

How to capitalize the first letter in custom textview?

In Custom TextView suppose if first character as a number then next character would be a character. How to find the first character amoung numbers.
Dhivyaseetha_Kumba
  • 164
  • 1
  • 1
  • 7
4
votes
3 answers

Capitalize with dplyr

I am doing data cleaning with dplyr. One of the things I want to do is to capitalize values in certain columns. data$surname john Mary John mary ... I suppose I have to use the mutate function of dplyr with something like…
4
votes
3 answers

Capitalizing words in an array, Ruby

I'm going through App Academy's Ruby Prep questions, and I want to know why this solution works. It appears that the words array is never altered and yet the method works. Is this a glitch in the matrix, or is it right under my nose? def…
Styx_
  • 135
  • 3
  • 9
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
2 answers

Sometimes capitalized column name will be converted to lower case in MySQL windows?

Like accountId -> accountid Has anyone met this kind of problem? It doesn't happen every day,though.
user198729
  • 61,774
  • 108
  • 250
  • 348
4
votes
4 answers

Capitalize first letter of TextView in an Android layout xml file

I have a TextView in a layout xml file like this: My string is specified like this:
qwertzguy
  • 15,699
  • 9
  • 63
  • 66
3
votes
5 answers

how to CaPiTaLiZe every other character in php?

I want to CaPiTaLiZe $string in php, don't ask why :D I made some research and found good answers here, they really helped me. But, in my case I want to start capitalizing every odd character (1,2,3...) in EVERY word. For example, with my custom…
Lado Lomidze
  • 1,503
  • 5
  • 19
  • 32
3
votes
3 answers

Why do we need to check string length larger than 0?

I got this example from CS50. I know that we need to check "s == NULL" in case there is no memory in the RAM. But, I am not sure why do we need to check the string length of t before capitalize. #include #include #include…
Consxious
  • 53
  • 6