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
7
votes
1 answer

Capitalize first letter of string in Makefile using bash 4 syntax

In bash 4 (and above), to capitalize the first letter of a string stored in variable L1, I can do the following: L1=en Ll1=${L1^} echo $Ll1 This prints En. I'm trying to do something similar within a Makefile, but I can't get the ${L1^} syntax to…
Proyag
  • 2,132
  • 13
  • 26
7
votes
2 answers

Should aria-label's be capitalized?

I've seen some examples and documentation that capitalizes the first word of aria labels. Why is this? What if you have two words?
ravip0711
  • 371
  • 5
  • 19
7
votes
4 answers

How to capitalize string in fish shell?

I got the following text: Lorem ipsum dolor sit amet, consectetur adipisicing elit. That I want to capitalize, i.e. uppercase first letter of every word. Expected result Lorem Ipsum Dolor Sit Amet, Consectetur Adipisicing Elit. Bash…
Édouard Lopez
  • 40,270
  • 28
  • 126
  • 178
7
votes
1 answer

QML TextField how to capitalize the text

In QML how can I have a text input box that automatically converts the inputted text to all capitals? The following doesn't work: TextField { id: myfield objectName: "myfield" ... font.pixelSize: 20 …
glennr
  • 2,069
  • 2
  • 26
  • 37
7
votes
1 answer

How do I preserve capitalization when using autocomplete in emacs?

How do I preserve capitalization when using the Auto Complete extension in emacs? So that example cannot be completed as Example or EXAMPLE.
Rebecca Meritz
  • 722
  • 1
  • 5
  • 15
7
votes
1 answer

How to disable automatic capitalization while typing in Outlook 2011 on Mac?

When I type the word "IDs" (no quotes) in an email it changes to "Ids" automatically. How do I disable the automatic capitalization?
Chad Clark
  • 418
  • 6
  • 12
6
votes
6 answers

JavaScript Code to Capitalize Text Inputs

I'm using the popular Firefox extension Greasemonkey. I'd like to know if there was a way to capitalize all text inputs in a certain form, so if I would use jQuery the code would look something like: $('form#formid…
henryaaron
  • 6,042
  • 20
  • 61
  • 80
6
votes
6 answers

Capitalize last letter of a string

How can I capitalize only the last letter of a string. For example: hello becomes: hellO
Kathy
  • 61
  • 1
  • 2
6
votes
9 answers

How to capitalize the first character of sentence using Swift

I have a String description that holds my sentence and want to capitalize only the first letter. I tried different things but most of them give me exceptions and errors. I'm using Xcode 6. Here is what I tried so far: let cap =…
Romaldowoho
  • 405
  • 1
  • 7
  • 20
6
votes
5 answers

Capitalized NSArray of Strings?

I have an NSarray called array. And it look like this array = @[@"one", @"two", @"three"]; I want this array to be capitalized. What is the best way to go about this. I can only think of making an NSMutableArray called mutableArray. And do…
iqueqiorio
  • 1,149
  • 2
  • 35
  • 78
6
votes
4 answers

Check if a string is all-caps in Emacs lisp?

all. I was wondering if Emacs lisp had a built-in function for checking if a string is made entirely out of capitalized characters. Here is what I'm using right now: (setq capital-letters (string-to-list "ABCDEFGHIJKLMNOPQRSTUVWXYZ")) (defun…
Masterofpsi
  • 769
  • 6
  • 17
6
votes
4 answers

Format lowercased string to capitalize the begining of each sentence

I have a string like FIRST SENTENCE. SECOND SENTENCE. I want to lowercase the string in that way to capitalize the first letter of each sentence. For example: string = string.toLowerCase().capitalize(); only the first sentence is capitalized. I…
zsola3075457
  • 177
  • 4
  • 14
6
votes
4 answers

Capitalizing strings which contain accented characters

I'm trying to find a solution for capitalising names in a perl webapp (using perl v5.10.1). I originally thought to use Lingua::EN::NameCase, but am seeing some problems with accented characters. I need to be able to deal with accented characters…
5
votes
8 answers

Permutations of capitalization

I want to build a list containing every possible permutation of capitalization of a word. so it would be List permutate(string word) { List ret = new List(); MAGIC HAPPENS HERE return ret; } So say I put in…
Scott Chamberlain
  • 124,994
  • 33
  • 282
  • 431
5
votes
1 answer

Using replace and regex to capitalize first letter of each word of a string in JavaScript

The following,though redundant, works perfectly : 'leap of, faith'.replace(/([^ \t]+)/g,"$1"); and prints "leap of, faith", but in the following : 'leap of, faith'.replace(/([^ \t]+)/g,RegExp.$1); it prints "faith faith faith" As a result…
Daud
  • 7,429
  • 18
  • 68
  • 115