public static void main(String[] args) {
    System.out.print("Zadej slovo: ");  
    String slovo = VstupString.ctiString(); 

    switch (slovo.toLowerCase().charAt(slovo.length() - 1)) {
      case 'l': slovo = new String(slovo.toLowerCase());break; 
      case 'u': slovo = new String(slovo.toUpperCase());break; 
      case 'x': 
                StringBuffer s = new StringBuffer(slovo.length() -1);  
                int ch; 
                
                for (int i = 0; i < slovo.length(); i++) {
                  ch = Integer.valueOf(slovo.charAt(i)).intValue(); 
                  if ((ch > 64) && (ch < 91)) 
                    ch += 32; 
                  else if ((ch > 96) && (ch < 123)) 
                    ch -= 32; 
                  s.append((char) ch); 
                }
                slovo = new String(s); 
                break; 
    }
  
    System.out.println(slovo); 
  }