Java String Capitalize capitalize(String s)

Here you can find the source of capitalize(String s)

Description

capitalize

License

Apache License

Declaration

public static String capitalize(String s) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {

    public static String capitalize(String s) {
        char ch[];
        ch = s.toCharArray();// w  ww.  j  a v a 2  s . c  om
        if (ch[0] >= 'a' && ch[0] <= 'z') {
            ch[0] = (char) (ch[0] - 32);
        }
        String newString = new String(ch);
        return newString;
    }
}

Related

  1. capitalize(String orig)
  2. capitalize(String original)
  3. capitalize(String propertyName)
  4. capitalize(String pString)
  5. capitalize(String s)
  6. capitalize(String s)
  7. capitalize(String s)
  8. capitalize(String s)
  9. capitalize(String s)