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()) {
this.firstName = null;
} 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()) {
this.lastName = null;
} else {
this.lastName = lastName;
// Capitalize the first letter
this.lastName = lastName.substring(0,1).toUpperCase() + lastName.substring(1);
}
}


Loading…
Cancel
Save