Advertisement
Guest User

Untitled

a guest
Sep 15th, 2013
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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) {
  29. String zinUitvoer = "";
  30. char ongefilterd[] = zinInvoer.toCharArray();
  31. String filteren = new String(ongefilterd);
  32. char a = filteren.charAt(65);
  33. System.out.println("Gefilterd: " + filteren);
  34. return zinInvoer;
  35. }
  36. }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement