Skip to content

Instantly share code, notes, and snippets.

@seandavi
Created October 1, 2019 02:08
Show Gist options
  • Select an option

  • Save seandavi/1d40992c34065e59d52e19a89a5c30e8 to your computer and use it in GitHub Desktop.

Select an option

Save seandavi/1d40992c34065e59d52e19a89a5c30e8 to your computer and use it in GitHub Desktop.
Java string play
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