Skip to content

Instantly share code, notes, and snippets.

@alexejVasko
Created February 23, 2016 16:06
Show Gist options
  • Save alexejVasko/85ee746a09e6393798db to your computer and use it in GitHub Desktop.
Save alexejVasko/85ee746a09e6393798db to your computer and use it in GitHub Desktop.
package task1;
import java.util.Scanner;
public class New {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
String s1 = scanner.nextLine();
System.out.println("input string = " + s1);
System.out.println();
if (s1.indexOf("new") >= 0)
System.out.println("string after NEW = " + s1.substring(s1.indexOf("new")+3, s1.length()));
else System.out.println("no NEW....");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment