Skip to content

Commit

Permalink
Closes #4
Browse files Browse the repository at this point in the history
  • Loading branch information
Olivier Chédru committed Apr 19, 2016
1 parent fa41014 commit be781d4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/main/java/org/dhatim/fastexcel/Workbook.java
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,11 @@ int getIndex(Worksheet ws) {
public Worksheet newWorksheet(String name) {
// Replace chars forbidden in worksheet names (backslahses and colons) by dashes
String sheetName = name.replaceAll("[/\\\\\\?\\*\\]\\[\\:]", "-");

// Maximum length worksheet name is 31 characters
if (sheetName.length() > 31) {
sheetName = sheetName.substring(0, 31);
}
Worksheet worksheet = new Worksheet(this, sheetName);
synchronized (worksheets) {
worksheets.add(worksheet);
Expand Down

0 comments on commit be781d4

Please sign in to comment.