Convert first character of a string to upper case.

@param value String to convert
@return Converted string
558980
private String firstUpper(String value) {
        return value == null ? null : value.substring(0, 1).toUpperCase() + value.substring(1);
    }
1084048
public static String toStudlyCase(final String value) {
        validate(value, NULL_STRING_PREDICATE, NULL_STRING_MSG_SUPPLIER);
        String[] words = collapseWhitespace(value.trim()).split("\\s*(_|-|\\s)\\s*");
        return Arrays.stream(words).filter(w -> !w.trim().isEmpty()).map(Strman::upperFirst).collect(joining());
    }
211472
public static String escape(final String value) {
        final StringBuilder builder = new StringBuilder();
        for (final char ch : value.toCharArray()) {
            builder.append(ESCAPES.containsKey(ch) ? ESCAPES.get(ch) : ch);
        }
        return builder.toString();
    }
282035
public static boolean isUpperCase(CharSequence value) {
		return StrUtil.isAllCharMatch(value, new cn.hutool.core.lang.Matcher<Character>() {
			@Override
			public boolean match(Character t) {
				return Character.isUpperCase(t);
			}
		});
	}
1097758
public static String escape(String value) {
        for (int i = 0; i < value.length(); i++) {
            if (isEscapingChar(value.charAt(i))) {
                return doEscape(value.getBytes(StandardCharsets.UTF_8), i);
            }
        }
        return value;
    }
188124
private String escapeString(String value)
   {
      m_buffer.setLength(0);
      m_buffer.append('"');
      for (int index = 0; index < value.length(); index++)
      {
         char c = value.charAt(index);
         switch (c)
         {
            case '"':
            {
               m_buffer.append("\\\"");
               break;
            }

            case '\\':
            {
               m_buffer.append("\\\\");
               break;
            }

            case '/':
            {
               m_buffer.append("\\/");
               break;
            }

            case '\b':
            {
               m_buffer.append("\\b");
               break;
            }

            case '\f':
            {
               m_buffer.append("\\f");
               break;
            }

            case '\n':
            {
               m_buffer.append("\\n");
               break;
            }

            case '\r':
            {
               m_buffer.append("\\r");
               break;
            }

            case '\t':
            {
               m_buffer.append("\\t");
               break;
            }

            default:
            {
               // Append if it's not a control character (0x00 to 0x1f)
               if (c > 0x1f)
               {
                  m_buffer.append(c);
               }
               break;
            }
         }
      }
      m_buffer.append('"');
      return m_buffer.toString();
   }
528116
private static String upperCaseFirstChar(String s) {
        return Character.toUpperCase(s.charAt(0)) + s.substring(1);
    }
4038
public String convertToUpperCase(String value) {
        String result = null;
        if (value != null) {
            result = value.toUpperCase();
        }
        return result;
    }
119504
public static String toReadableLabel(String value) {
        StringBuilder ret = new StringBuilder();
        char lastChar = 'x';
        for (int i = 0; i < value.length(); i++) {
            char currentChar = value.charAt(i);
            // we are the begining of the output
            // or the last char was a space
            // then uppercase
            if ((i == 0 || lastChar == ' ') && !(isSeparator(currentChar))) {
                currentChar = Character.toUpperCase(currentChar);
            } else if (Character.isLowerCase(lastChar) && Character.isUpperCase(currentChar)) {
                // we switched case --> add a space
                ret.append(' ');
            } else if (isSeparator(currentChar)) {
                // we are on a _, this is a space
                currentChar = ' ';
            }

            if (!(lastChar == ' ' && currentChar == ' ')) {
                ret.append(currentChar);
                lastChar = currentChar;
            }
        }

        if (ret.toString().startsWith("Is ") || ret.toString().startsWith("Has ")) {
            ret.append('?');
        }

        return ret.toString();
    }
419220
public static CharSequence toParameterValue(final Object value) {
        if (value instanceof Long) {
            return toParameterValue((Long) value);
        } else if (value instanceof Integer) {
            return toParameterValue((Integer) value);
        } else if (value instanceof Boolean) {
            return toParameterValue((Boolean) value);
        } else if (value instanceof Float) {
            return toParameterValue((Float) value);
        } else if (value instanceof JavaScriptInlineFunction) {
            return toParameterValue((JavaScriptInlineFunction) value);
        } else if (value instanceof Duration) {
            return String.valueOf(((Duration) value).getMilliseconds());
        } else if (value instanceof Attr.MarkupId) {
            return ((Attr.MarkupId)value).quoted().toString();
        } else if (value instanceof Attr) {
            return value.toString();
        } else if (value instanceof JsonNode) {
            return Json.stringify(value);
        } else if (value instanceof Config) {
            return ((Config)value).toJsonString();
        }

        return value != null ? "'" + String.valueOf(value) + "'" : Attr.nullValue();
    }
695483
public static Character toChar(Object value, Character defaultValue) {
		return convert(Character.class, value, defaultValue);
	}
616124
public static String capitalize(final String string)
   {
      if (string == null)
         throw new IllegalArgumentException("string");
      if (string.equals(""))
         throw new IllegalArgumentException("string");

      return Character.toUpperCase(string.charAt(0)) + string.substring(1);
   }
1293719
public static String toUpperCase(String string, Locale locale) {

    if (locale == null) {
      return toUpperCase(string, STANDARD_LOCALE);
    }
    return string.toUpperCase(locale);
  }
96035
public static String encodeString(final String value) {
    StringBuilder out = new StringBuilder();
    encodeString( value, out );
    return out.toString();
  }
103890
public static String getPrefixFromValue(String value) {
    if (value == null) {
      return null;
    } else if (value.contains(DELIMITER)) {
      String[] list = value.split(DELIMITER);
      if (list != null && list.length > 0) {
        return list[0].replaceAll("\u0000", "");
      } else {
        return null;
      }
    } else {
      return value.replaceAll("\u0000", "");
    }
  }
530532
private static String toLowerUnderscoreFromCamel(final String value)
    {
        if (value.isEmpty())
        {
            return value;
        }
        final String s = toLowerFirstChar(value);

        // include some extra space for separators
        final StringBuilder out = new StringBuilder(s.length() + 4);
        int i = 0;
        int j = -1;
        while ((j = indexInUpperAlphaRange(s, ++j)) != -1)
        {
            final String word = s.substring(i, j).toLowerCase();
            out.append(word);
            if (!word.endsWith("_"))
            {
                out.append("_");
            }
            i = j;
        }

        return (i == 0) ? s.toLowerCase() : out.append(s.substring(i).toLowerCase()).toString();
    }
583460
public static CharSequence toParameterValue(final Boolean value) {
        return value != null ? Boolean.toString(value) : Attr.nullValue();
    }