MCPcopy Create free account
hub / github.com/BaseXdb/basex / capitalize

Method capitalize

basex-core/src/main/java/org/basex/util/Strings.java:258–263  ·  view source on GitHub ↗

Capitalizes the first letter of a string. @param string input string @return capitalized string

(final String string)

Source from the content-addressed store, hash-verified

256 * @return capitalized string
257 */
258 public static String capitalize(final String string) {
259 final StringBuilder sb = new StringBuilder();
260 if(!string.isEmpty())
261 sb.append(Character.toUpperCase(string.charAt(0))).append(string.substring(1));
262 return sb.toString();
263 }
264
265 /**
266 * Returns a regular English singular/plural form for the specified noun.

Callers 5

capitalizeMethod · 0.95
typeErrorMethod · 0.95
createMethod · 0.95
toStringMethod · 0.95
uriToClasspathMethod · 0.95

Calls 5

charAtMethod · 0.80
appendMethod · 0.65
toStringMethod · 0.65
isEmptyMethod · 0.45
substringMethod · 0.45

Tested by 1

capitalizeMethod · 0.76