Skip to content
This repository was archived by the owner on Feb 26, 2023. It is now read-only.
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Add upperCaseFirst to CaseHelper
  • Loading branch information
dodgex committed Jun 18, 2018
commit 266d93675d7d9f98ddcf5c4c285f2d8d8ecb4f1f
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/**
* Copyright (C) 2010-2016 eBusiness Information, Excilys Group
* Copyright (C) 2016-2018 the AndroidAnnotations project
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
Expand Down Expand Up @@ -72,6 +73,15 @@ public static String lowerCaseFirst(String string) {
return first + end;
}

public static String upperCaseFirst(String string) {
if (string.length() < 2) {
return string.toUpperCase();
}
String first = string.substring(0, 1).toUpperCase();
String end = string.substring(1, string.length());
return first + end;
}

public static String camelCaseToUpperSnakeCase(String prefix, String camelCase, String suffix) {
if (prefix != null && !camelCase.startsWith(prefix)) {
camelCase = prefix + "_" + camelCase;
Expand Down