Answered by : godswill-ohiole-agangan
const word = "freecodecamp"
const capitalized = word.charAt(0).toUpperCase() + word.slice(1)
// Freecodecamp
// F is capitalized
Source : https://www.freecodecamp.org/news/javascript-capitalize-first-letter-of-word/ | Last Update : Fri, 01 Jul 22
Answered by : kazi-mahbubur-rahman
const lower = 'this is an entirely lowercase string';
const upper = lower.charAt(0).toUpperCase() + lower.substring(1);
Source : | Last Update : Wed, 27 Jul 22
Answered by : helpless-hamster-iyyzaozffwgx
>>> "hello world".title()
'Hello World'
>>> u"hello world".title()
u'Hello World'
Source : https://stackoverflow.com/questions/1549641/how-can-i-capitalize-the-first-letter-of-each-word-in-a-string | Last Update : Tue, 28 Jun 22
Answered by : friendly-ferret-3liqcxrky19d
var str = "hello world";
str = str.toLowerCase().replace(/\b[a-z]/g, function(letter) { return letter.toUpperCase();
});
alert(str); //Displays "Hello World"
Source : https://stackoverflow.com/questions/5122402/uppercase-first-letter-of-variable | Last Update : Mon, 04 Oct 21
Answered by : itchy-iguana-yewbikurcqns
const name = 'flavio'
const nameCapitalized = name.charAt(0).toUpperCase() + name.slice(1)
Source : https://www.tech-wiki.online/en/how-to-uppercase-first-letter-javascript.html | Last Update : Sun, 23 Jan 22
Answered by : troubled-tapir-axuezag30mer
String name;
BufferedReader br = new InputStreamReader(System.in);
String s1 = name.charAt(0).toUppercase());
System.out.println(s1 + name.substring(1));
Source : https://stackoverflow.com/questions/3904579/how-to-capitalize-the-first-letter-of-a-string-in-java | Last Update : Fri, 27 May 22
Answered by : doubtful-dogfish-afpaozrlqjc7
string.charAt(index)
Source : https://flexiple.com/javascript-capitalize-first-letter/ | Last Update : Tue, 26 Oct 21
Answered by : sairatna-kamble
public static void main(String[] args) { System.out.println("Enter name"); Scanner kb = new Scanner (System.in); String text = kb.next(); if ( null == text || text.isEmpty()) { System.out.println("Text empty"); } else if (text.charAt(0) == (text.toUpperCase().charAt(0))) { System.out.println("First letter in word "+ text + " is upper case"); } }
Source : https://stackoverflow.com/questions/4452939/in-java-how-to-find-if-first-character-in-a-string-is-upper-case-without-regex | Last Update : Tue, 06 Sep 22