1string s="hello";
2s = Character.toUpperCase(s.charAt(0)) + s.substring(1);
3The output will be: Hello
1const upperCase = function(names){
2 const toLower = names.toLowerCase().split(' ');
3 const namesUpper = [];
4 for(const wordName of toLower){
5 namesUpper.push(wordName[0].toUpperCase() + wordName.slice(1));
6 }
7 return namesUpper.join(' ');
8}
1public class Guru99 {
2 public static void main(String args[]) {
3 String S1 = new String("minúsculas convertidas en mayúsculas");
4
5 // Convertir a UpperCase
6 System.out.println(S1.toUpperCase());
7 }
8}
9
1public class StringToUppercaseDemo
2{
3 public static void main(String[] args)
4 {
5 String str = "flower brackets";
6 String strUpper = str.toUpperCase();
7 System.out.println(strUpper);
8 }
9}
1String txt = "Hello World";
2System.out.println(txt.toUpperCase()); // Outputs "HELLO WORLD"
3System.out.println(txt.toLowerCase()); // Outputs "hello world"
4