tolowercase
字符串toLowerCase()方法 (String toLowerCase() Method)
toLowerCase() method is a String class method, it is used to convert given string into the lowercase.
toLowerCase()方法是String類方法,用于將給定的字符串轉換為小寫。
Syntax:
句法:
String String_object.toLowerCase();
Here, String_object is a String object which we have to convert into lowercase. The method does not change the string; it returns the lowercase converted string.
在這里, String_object是一個String對象,我們必須將其轉換為小寫形式。 該方法不更改字符串。 它返回小寫轉換后的字符串。
Example:
例:
Input:
str = "Welcome at IncludeHelp!"
Function call:
ans = str.toLowerCase()
Output:
ans = "welcome at includehelp!"
Code:
碼:
public class Main
{
public static void main(String[] args) {
String str = "Welcome at IncludeHelp!";
String ans = str.toLowerCase();
System.out.println("str = " + str);
System.out.println("ans = " + ans);
}
}
Output
輸出量
str = Welcome at IncludeHelp!
ans = welcome at includehelp!
翻譯自: https://www.includehelp.com/java/string-toLowerCase-method-with-example.aspx
tolowercase