Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- /**
- * @author aothma2s
- */
- public class Eingabe {
- public static int filter(String start,String stop,String skip){
- int anz= 0;
- Scanner sc = new Scanner(System.in);
- String result = "";
- String s = "";
- while(sc.hasNext()){
- s = sc.next();
- if(s.equals(start)){
- while(sc.hasNext() && !s.equals(stop))
- {
- s = sc.next();
- }
- }
- else if(s.equals(skip))
- {
- s = sc.nextLine();
- }
- else {
- result = result + s + " ";
- ++anz;
- }
- }
- System.out.println(result);
- return anz;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement