Java tutorial
import java.util.Arrays; public class Main { public static void main(String[] args) { String str = "Result"; String str1 = "rEsLtu"; char[] firstString = str.toLowerCase().toCharArray(); char[] secondString = str1.toLowerCase().toCharArray(); Arrays.sort(firstString); Arrays.sort(secondString); if (Arrays.equals(firstString, secondString) == true) { System.out.println("same"); } else { System.out.println("different"); } } }