Here you can find the source of uncapitalize(String source)
Parameter | Description |
---|---|
source | The <code>String</code> to uncapitalize. |
String
.
public static String uncapitalize(String source)
//package com.java2s; /*/*from w ww. j ava 2 s . c om*/ * Copyright 2001-2013 Geert Bevin (gbevin[remove] at uwyn dot com) * Licensed under the Apache License, Version 2.0 (the "License") */ public class Main { /** * Ensure that the first character of the provided string lower case. * * @param source The <code>String</code> to uncapitalize. * @return The uncapitalized <code>String</code>. * @since 1.5 */ public static String uncapitalize(String source) { if (source == null || source.length() == 0) { return source; } if (source.length() > 1 && Character.isLowerCase(source.charAt(0))) { return source; } char chars[] = source.toCharArray(); chars[0] = Character.toLowerCase(chars[0]); return new String(chars); } }