Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * @author aothma2s
- */
- import java.util.Scanner;
- public class Leser {
- public static String vorNach(Scanner sc)
- {
- String ret = "";
- String vor_nach = sc.next();
- String word = sc.next();
- String num = sc.next();
- if(vor_nach.equals("vor") && word.contains(num))
- {
- ret = word.substring(0, word.lastIndexOf(num));
- }
- else if(vor_nach.equals("nach")) {
- ret = word.substring(word.indexOf(num)+1,word.length());
- }
- else
- {
- ret += "";
- }
- return vor_nach+" "+ret+" "+"in "+word;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement