1 package org.smartcomps.twister.common.util;
2
3 /***
4 * Utilities for string manipulation
5 */
6 public class StringUtil {
7 /***
8 * Capitalizes the first character of the given string
9 * @param str
10 * @return
11 */
12 public static String capitalizeFirstCharacter(String str) {
13 String first = str.substring(0, 1).toUpperCase();
14 String res = first + str.substring(1);
15 return res;
16 }
17
18 /***
19 * return the classname whitout package.
20 * @param fullClassName
21 * @return
22 */
23 public static String getClassName(String fullClassName) {
24 return fullClassName.substring(fullClassName.lastIndexOf(".")+1);
25 }
26
27 public static boolean booleanValue(String booleanAsString){
28 boolean res = false;
29 if("yes".equalsIgnoreCase(booleanAsString) ||
30 "1".equalsIgnoreCase(booleanAsString) ||
31 "true".equalsIgnoreCase(booleanAsString)) {
32 res = true;
33 }
34 return res;
35 }
36
37 }
This page was automatically generated by Maven