From 78949d9f61c86c63de86bf5ccca1add8f1262e3c Mon Sep 17 00:00:00 2001 From: SakshamGupta1995 <44345026+SakshamGupta1995@users.noreply.github.com> Date: Fri, 29 Mar 2019 14:52:17 +0530 Subject: [PATCH] Add Case conversion functions to the article (#26922) * Add Case conversion functions to the article These functions tell the programmers about converting their string data type value either into upper case letters or lower case letters. * Fix formatting and phrasing --- guide/english/java/strings/index.md | 37 +++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/guide/english/java/strings/index.md b/guide/english/java/strings/index.md index ddebc30d03..12187e95b3 100644 --- a/guide/english/java/strings/index.md +++ b/guide/english/java/strings/index.md @@ -220,5 +220,42 @@ The result will be: Free ``` + +#### String Case Conversion + +1. `.toLowerCase()` - This method will convert the string into lower case characters. + Example: + ```java + String text1 = "Welcome99"; + String text2 = "WELCOME"; + String text3 = "well"; + System.out.println(text1.toLowerCase()); + System.out.println(text2.toLowerCase()); + System.out.println(text3.toLowerCase()); + ``` + The output will be:- + ``` + welcome99 + welcome + well + ``` +2. `.toUpperCase()` - This method will convert the string into upper case characters. + Example: + + ```java + String text1 = "Welcome99"; + String text2 = "WELCOME"; + String text3 = "well"; + System.out.println(text1.toUpperCase()); + System.out.println(text2.toUpperCase()); + System.out.println(text3.toUpperCase()); + ``` + The output will be:- + ``` + WELCOME99 + WELCOME + WELL + ``` + **More Information:** - [String Documentation](https://docs.oracle.com/javase/7/docs/api/java/lang/String.html)