What is a toLowerCase?
The java toLowerCase() method of String class is used for getting a substring from the string.
public final class String extends Object implements Serializable, Comparable<String>, CharSequence, Constable, ConstantDesc
...
The String
class represents character strings. All string literals in Java programs, such as "abc"
, are implemented as instances of this class.
Beginning with JDK 9, all of java.lang is part of the java.base module. The String
class represents character strings. All string literals in Java programs, such as "abc"
, are implemented as instances of this class.
Java Platform, Standard Edition & Java Development Kit Version 16 API Specification |
Module java.base |
Package java.lang |
Class String |
Because String objects are immutable, whenever you want to modify a String, you must either copy it into a StringBuffer or StringBuilder, or use a String method that constructs a new copy of the string with your modifications complete.
Syntax #1 of String toLowerCase() method
public String toLowerCase()
The Java String toLowerCase()
method converts a string to lower case letters using the rules of the default locale. .
String toLowerCase Example #1
package com.yuriyni.java.base.java.lang;
public class ToLowerCaseDemo {
public static void main(String[] args) {
String myStr = "YURIYNI.COM";
System.out.print(myStr.toLowerCase());
}
}
Output
yuriyni.com