/** * Formats a string into "THIS_KIND_OF_FORMAT_ABC_DEF". * * @return * Always return a string but there's no guarantee that * the generated code is a valid Java identifier. */ public String toConstantName(List<String> ss) { StringBuilder sb = new StringBuilder(); if( !ss.isEmpty() ) { sb.append(toUpperCase(ss.get(0))); for (int i = 1; i < ss.size(); i++) { sb.append('_'); sb.append(toUpperCase(ss.get(i))); } } return sb.toString(); }
/** * Capitalizes the first character of the specified string, * and de-capitalize the rest of characters. */ public String capitalize(String s) { if (!isLower(s.charAt(0))) return s; StringBuilder sb = new StringBuilder(s.length()); sb.append(toUpperCase(s.charAt(0))); sb.append(toLowerCase(s.substring(1))); return sb.toString(); }
/** * Formats a string into "THIS_KIND_OF_FORMAT_ABC_DEF". * * @return * Always return a string but there's no guarantee that * the generated code is a valid Java identifier. */ public String toConstantName(List<String> ss) { StringBuilder sb = new StringBuilder(); if( !ss.isEmpty() ) { sb.append(toUpperCase(ss.get(0))); for (int i = 1; i < ss.size(); i++) { sb.append('_'); sb.append(toUpperCase(ss.get(i))); } } return sb.toString(); }
/** * Capitalizes the first character of the specified string, * and de-capitalize the rest of characters. */ public String capitalize(String s) { if (!isLower(s.charAt(0))) return s; StringBuilder sb = new StringBuilder(s.length()); sb.append(toUpperCase(s.charAt(0))); sb.append(toLowerCase(s.substring(1))); return sb.toString(); }
/** * Formats a string into "THIS_KIND_OF_FORMAT_ABC_DEF". * * @return * Always return a string but there's no guarantee that * the generated code is a valid Java identifier. */ public String toConstantName(List<String> ss) { StringBuilder sb = new StringBuilder(); if( !ss.isEmpty() ) { sb.append(toUpperCase(ss.get(0))); for (int i = 1; i < ss.size(); i++) { sb.append('_'); sb.append(toUpperCase(ss.get(i))); } } return sb.toString(); }
/** * Formats a string into "THIS_KIND_OF_FORMAT_ABC_DEF". * * @return * Always return a string but there's no guarantee that * the generated code is a valid Java identifier. */ public String toConstantName(List<String> ss) { StringBuilder sb = new StringBuilder(); if( !ss.isEmpty() ) { sb.append(toUpperCase(ss.get(0))); for (int i = 1; i < ss.size(); i++) { sb.append('_'); sb.append(toUpperCase(ss.get(i))); } } return sb.toString(); }
/** * Capitalizes the first character of the specified string, * and de-capitalize the rest of characters. */ public String capitalize(String s) { if (!isLower(s.charAt(0))) return s; StringBuilder sb = new StringBuilder(s.length()); sb.append(toUpperCase(s.charAt(0))); sb.append(toLowerCase(s.substring(1))); return sb.toString(); }
/** * Formats a string into "THIS_KIND_OF_FORMAT_ABC_DEF". * * @return * Always return a string but there's no guarantee that * the generated code is a valid Java identifier. */ public String toConstantName(List<String> ss) { StringBuilder sb = new StringBuilder(); if( !ss.isEmpty() ) { sb.append(toUpperCase(ss.get(0))); for (int i = 1; i < ss.size(); i++) { sb.append('_'); sb.append(toUpperCase(ss.get(i))); } } return sb.toString(); }
/** * Formats a string into "THIS_KIND_OF_FORMAT_ABC_DEF". * * @return * Always return a string but there's no guarantee that * the generated code is a valid Java identifier. */ public String toConstantName(List<String> ss) { StringBuilder sb = new StringBuilder(); if( !ss.isEmpty() ) { sb.append(toUpperCase(ss.get(0))); for (int i = 1; i < ss.size(); i++) { sb.append('_'); sb.append(toUpperCase(ss.get(i))); } } return sb.toString(); }
/** * Capitalizes the first character of the specified string, * and de-capitalize the rest of characters. */ public String capitalize(String s) { if (!isLower(s.charAt(0))) return s; StringBuilder sb = new StringBuilder(s.length()); sb.append(toUpperCase(s.charAt(0))); sb.append(toLowerCase(s.substring(1))); return sb.toString(); }
/** * Capitalizes the first character of the specified string, * and de-capitalize the rest of characters. */ public String capitalize(String s) { if (!isLower(s.charAt(0))) return s; StringBuilder sb = new StringBuilder(s.length()); sb.append(toUpperCase(s.charAt(0))); sb.append(toLowerCase(s.substring(1))); return sb.toString(); }
/** * Capitalizes the first character of the specified string, * and de-capitalize the rest of characters. */ public String capitalize(String s) { if (!isLower(s.charAt(0))) return s; StringBuilder sb = new StringBuilder(s.length()); sb.append(toUpperCase(s.charAt(0))); sb.append(toLowerCase(s.substring(1))); return sb.toString(); }