View difference between Paste ID: WjwPMSJT and gA8777wS
SHOW: | | - or go back to the newest paste.
1
package deel1;
2
3
import java.util.*;
4
5
public class Deel1 {
6
7
    public static void main(String[] args) {
8
        String zinInvoer = getInput();
9
        String zinUitvoer = filterZin(zinInvoer);
10
    }
11
12
    static String getInput() {
13
        Scanner scan = new Scanner(System.in);
14
        String zinInvoer = "";
15
16
        System.out.println("Voer een zin in: ");
17
        if (scan.hasNextLine()) {
18
            zinInvoer = scan.nextLine().trim();
19
        }
20
21
        if (zinInvoer.equals("")) {
22
            System.out.println("Geen invoer!");
23
            System.exit(0);
24
        }
25
        return zinInvoer;
26
    }
27
28-
	static String filterZin(String zinInvoer) {
28+
    static String filterZin(String zinInvoer) {
29-
       	 String zinUitvoer = "";
29+
        String zinUitvoer = "";
30-
       	 char ongefilterd[] = zinInvoer.toCharArray();
30+
            char ongefilterd[] = zinInvoer.toCharArray();
31-
        String gefilterd = new String(ongefilterd);
31+
            String filteren = new String(ongefilterd);
32-
        System.out.println("Gefilterd: " + gefilterd);
32+
            char a = filteren.charAt(65);
33
            System.out.println("Gefilterd: " + filteren);
34
            return zinInvoer;
35-
}
35+
36
    }
37-
}
37+