KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > roller > util > StringUtils


1 /*
2  * Created on Jun 3, 2004
3  */

4 package org.roller.util;
5
6 /**
7  * @author lance.lavandowska
8  */

9 public class StringUtils
10 {
11     public static boolean isEmpty(String JavaDoc str)
12     {
13         if (str == null) return true;
14         return "".equals(str.trim());
15     }
16     
17     public static boolean isNotEmpty(String JavaDoc str)
18     {
19         return !isEmpty(str);
20     }
21     
22     public static String JavaDoc[] split(String JavaDoc str1, String JavaDoc str2)
23     {
24        return org.apache.commons.lang.StringUtils.split(str1, str2);
25     }
26     
27     public static String JavaDoc replace(String JavaDoc src, String JavaDoc target, String JavaDoc rWith)
28     {
29         return org.apache.commons.lang.StringUtils.replace(src, target, rWith);
30     }
31     
32     public static String JavaDoc replace(String JavaDoc src, String JavaDoc target, String JavaDoc rWith, int maxCount)
33     {
34         return org.apache.commons.lang.StringUtils.replace(src, target, rWith, maxCount);
35     }
36     
37     public static boolean equals(String JavaDoc str1, String JavaDoc str2)
38     {
39         return org.apache.commons.lang.StringUtils.equals(str1, str2);
40     }
41     
42     public static boolean isAlphanumeric(String JavaDoc str)
43     {
44         return org.apache.commons.lang.StringUtils.isAlphanumeric(str);
45     }
46     
47     public static String JavaDoc[] stripAll(String JavaDoc[] strs)
48     {
49         return org.apache.commons.lang.StringUtils.stripAll(strs);
50     }
51     
52     public static String JavaDoc left(String JavaDoc str, int length)
53     {
54         return org.apache.commons.lang.StringUtils.left(str, length);
55     }
56 }
57
Popular Tags