Browse Source

Author's first & last name: capitalize the first letter

Signed-off-by: Pekka Helenius <fincer89@hotmail.com>
v0.0.2-alpha
Pekka Helenius 4 years ago
parent
commit
57e68f6e79
1 changed files with 4 additions and 2 deletions
  1. +4
    -2
      bookstore/src/main/java/com/fjordtek/bookstore/model/Author.java

+ 4
- 2
bookstore/src/main/java/com/fjordtek/bookstore/model/Author.java View File

@ -124,7 +124,8 @@ public class Author {
if (firstName.isEmpty()) { if (firstName.isEmpty()) {
this.firstName = null; this.firstName = null;
} else { } else {
this.firstName = firstName;
// Capitalize the first letter
this.firstName = firstName.substring(0,1).toUpperCase() + firstName.substring(1);
} }
} }
@ -136,7 +137,8 @@ public class Author {
if (lastName.isEmpty()) { if (lastName.isEmpty()) {
this.lastName = null; this.lastName = null;
} else { } else {
this.lastName = lastName;
// Capitalize the first letter
this.lastName = lastName.substring(0,1).toUpperCase() + lastName.substring(1);
} }
} }


Loading…
Cancel
Save