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

Count capitalized of each sentence in a paragraph Ruby

I answered my own question. Forgot to initialize count = 0 I have a bunch of sentences in a paragraph. a = "Hello there. this is the best class. but does not offer anything." as an example. To figure out if the first letter is capitalized, my…
mythoslife
  • 203
  • 1
  • 6
  • 20
-1
votes
1 answer

Letter → next letter and capitalize vowels

This code still doesn't seem to be working. It has no errors anymore, but it only returns blank brackets like this {}. It is supposed to turn each letter in str into the next letter and capitalize each vowel. Any ideas? function LetterChanges(str) {…
-2
votes
5 answers

Write a recursive function called capitalizeFirst. Given an array of strings, capitalize the first letter of each string in the array

I see this similar algorithm was posted on stackoverflow, nevertheless I cannot understand, so I decided to post once more. function capitalizeFirst(arr) { if (arr.length === 1) { return [arr[0].toUpperCase()] } let res =…
-2
votes
2 answers

Capitalise part of a string in javascript

I am trying to split a string and make part of the string capitalised. however the first letter of the first word must stay lowercase. Ideally a regex that would split the string and know to capitalise the rest of that word, before splitting the…
-2
votes
4 answers

iteration with map() function

I am trying to use the map() function and capitalize all the words in the list. my_pets = ['sisi', 'bibi', 'titi', 'carla'] def capitalizing(a): for item in a: b = item.upper() return b print(list(map(capitalizing,…
rodny9
  • 53
  • 1
  • 4
-2
votes
1 answer

Extract first character of each word from a text and capitalize it with a function and return method

def initials(text): result=bla bla bla return result main text=input("Please enter your text") initials(text)
-2
votes
1 answer

Python capitalizing first letter

If I want to Capitalized Just the first letter of inputed string of word and int how can i do it like: 2Bob SANdy wIwi output: 2bob Sandy Wiwi the "b" in Bob should be lowercase in the result Please need some help here, thx
-2
votes
1 answer

Capitalize ALL words in a triple String

My program has 3 Strings, that the user has already input, the purpose for this program is to capitalize all letters in the words. How do I capitalize all letters in each word using the toUpperCase(). This is what I have so far, this is a java…
-2
votes
1 answer

Make uppercase in array

Use of order Apartment Canada Toronto 38 37 2042 37 Appartment Building Apt 54 357 can you help for…
james
  • 11
  • 1
  • 8
-2
votes
1 answer

Capitalize first letter of each line using PHP

I'd like if there was a way to capitalize the first letter of each line using PHP.
-2
votes
2 answers

How to capitalize each letter after a special letter in android?

First of all, please don't mark it as duplicate. I have a very specific problem. I have to capitalize each word's first letter. Problem is that I can't find-out when a word start. For example, I have given String: 0nd0-cathay bank (federal…
Harish Godara
  • 2,388
  • 1
  • 14
  • 28
-2
votes
3 answers

Can't check if Ruby object is capitalised

I'm trying to check a condition: name = gets.chomp if name.capitalized == name puts 'some text' else puts name.capitalize + 'some text' im getting this error in the terminal: test.rb:6:in
': undefined methodcapitalized' for…
Haris Kumalic
  • 11
  • 1
  • 3
-3
votes
1 answer

Capitalizing last letter in Java using String methods

how can i capitalize the last letter of a String? Is there a method in the String Class to do this? I'm practicing with some exercise, and i was asked to do this with a method.
Juza
  • 17
  • 4
-3
votes
1 answer

rails split and capitalize words in [ ]

I am trying to capitalize words with a format like this: america [asia] europe and I want to make it look like this: America [Asia] Europe What regex should I put in the .split option?
-3
votes
1 answer

Capitalize letter in the middle of a string using python

I have been using the following code to capitalize words: with open("capitalize.txt") as f: for line in f: print line.title(), It works fine but I want to be able to capitalize letters in the middle of the string e.g change javascript to…
Padraic Cunningham
  • 176,452
  • 29
  • 245
  • 321
1 2 3
21
22