Convert string case

ReturnMethodSummary
StringtoLowerCase()Converts this String to lower case using the rules of the default locale.
StringtoLowerCase(Locale locale)Converts this String to lower case using the rules of the given Locale.
StringtoUpperCase()Converts this String to upper case using the rules of the default locale.
StringtoUpperCase(Locale locale)Converts this String to upper case using the rules of the given Locale.

public class Main {
  public static void main(String[] argv) {
    String str = "jAvA2s.com";
    System.out.println(str.toLowerCase());
    System.out.println(str.toUpperCase());

  }
}

The output:


java2s.com
JAVA2S.COM
www___._j_av_a_2__s_.c__o_m___ | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.