Advertisement
Guest User

Untitled

a guest
Feb 9th, 2017
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. /**
  2. * Created by DARK WRATH on 08-02-2017.
  3. */
  4. import java.util.*;
  5. public class AltLowerCase
  6. {
  7. public static void main(String args[])
  8. {
  9. Scanner s=new Scanner(System.in);
  10. System.out.println("Enter the sentence");
  11. String se1=s.nextLine();
  12. String se2=se1.replaceAll("['QWERTYUIOPASDFGHJKLZXCVBNM']", "['qwertyuiopasdfghjklzxcvbnm']");
  13. System.out.print(se2);
  14. }
  15. }
  16. // this will result logical error. So better avoid. //
  17. // however its not the logic. just trying a different approach. //
  18. //one should always go for String.toLowercase() //
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement