Created
October 1, 2019 02:08
-
-
Save seandavi/1d40992c34065e59d52e19a89a5c30e8 to your computer and use it in GitHub Desktop.
Java string play
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Main { | |
| public static void main(String[] args) { | |
| String s1 = "Taylor Swift"; | |
| String s2 = "John Boyega"; | |
| String s3 = "Emma Stone"; | |
| String s4 = s1.substring(2,s1.length()-3).toLowerCase(); | |
| String s5 = s2.substring(2,s2.length()-3).toLowerCase(); | |
| String s6 = s3.substring(2,s3.length()-3).toLowerCase(); | |
| System.out.println(s1 + ">>>" + s4 + "\n" + s2 + ">>>" + s5 + "\n"+ s3 + ">>>" + s6); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment