Categories
java String

Convert String to lowercase using java

Convert String to lowercase using java

In this example we will learn to convert a String to lowercase using java

Syntax

<span class="token function">toLowerCase</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>

Example

public class StringLowerCase {

  public static void main(String[] args) {
    String s="A guy from New WORLD ";
    // Below line will convert your string to lower case
    String lowerCase=s.toLowerCase();
    System.out.println(lowerCase);
  }
}

Output

a guy from new world

Reference

https://docs.oracle.com/javase/7/docs/api/java/lang/String.html#toLowerCase()