1 package com
.interrupt
.bob
.util
;
3 public class StringUtil
{
5 public static String
upperFirstLetter(String word
) {
7 String className
= word
.trim();
9 String firstLetter
= className
.substring(0,1);
10 String restOf
= className
.substring(1);
12 StringBuilder sb
= new StringBuilder(firstLetter
.toUpperCase());
18 public static String
namespaceToPackage(String word
) {
20 String pkg
= word
.trim();
21 pkg
= pkg
.replace('/','.');
23 if(pkg
.length() <= 0) {
27 int plength
= pkg
.length() - 1;
28 char lastchar
= pkg
.charAt(plength
);
30 pkg
= pkg
.substring(0, plength
);
37 public static String
packageToNamespace(String word
) {
39 String nspace
= word
.trim();
40 nspace
= nspace
.replace('.','/');
42 if(nspace
.length() <= 0) {
46 int plength
= nspace
.length() - 1;
47 char lastchar
= nspace
.charAt(plength
);
49 nspace
= nspace
.substring(0, plength
);