Advertisement
Domy131097

LV4: Zadatak 1

Nov 20th, 2017
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.76 KB | None | 0 0
  1. /**
  2.  * @author Dominik Tkalčec
  3.  */
  4.  
  5. package vjezba4;
  6.  
  7. import java.io.File;
  8.  
  9. public class Zad1 {
  10.    
  11.     public static void main(String[] args) {
  12.         File mape = new File("E:\\Dokumenti");
  13.         File[] lista = mape.listFiles();
  14.  
  15.         for (File i : lista){
  16.             System.out.println(i.getName());
  17.         }
  18.         for (File i : lista){
  19.             if((i.getName()).matches("(a|b|c|d|e|f|g|h|i|j|k|l|m|n).*")){
  20.                 System.out.println(i.getName().substring(0,1).toUpperCase()+i.getName().substring(1));
  21.             }
  22.         }
  23.         for (File i : lista){
  24.             if((i.getName()).matches("(o|p|r|q|r|s|t|u|v|w|x|y|z).*")){
  25.                 System.out.println(i.getName().toUpperCase());
  26.             }
  27.         }
  28.     }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement