home *** CD-ROM | disk | FTP | other *** search
/ PC Professionell 2004 December / PCpro_2004_12.ISO / files / webserver / xampp / xampp-tomcat-addon-1.4.9-installer.exe / Functions.class (.txt) < prev    next >
Encoding:
Java Class File  |  2004-05-17  |  1000 b   |  25 lines

  1. package jsp2.examples.el;
  2.  
  3. public class Functions {
  4.    public static String reverse(String text) {
  5.       return (new StringBuffer(text)).reverse().toString();
  6.    }
  7.  
  8.    public static int numVowels(String text) {
  9.       String vowels = "aeiouAEIOU";
  10.       int result = 0;
  11.  
  12.       for(int i = 0; i < text.length(); ++i) {
  13.          if (vowels.indexOf(text.charAt(i)) != -1) {
  14.             ++result;
  15.          }
  16.       }
  17.  
  18.       return result;
  19.    }
  20.  
  21.    public static String caps(String text) {
  22.       return text.toUpperCase();
  23.    }
  24. }
  25.