public class WorkbookUtil
extends java.lang.Object
Constructor and Description |
---|
WorkbookUtil() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
createSafeSheetName(java.lang.String nameProposal)
Creates a valid sheet name, which is conform to the rules.
(创建一个符合规则的有效工作表名称。)
|
static java.lang.String |
createSafeSheetName(java.lang.String nameProposal, char replaceChar)
Creates a valid sheet name, which is conform to the rules.
(创建一个符合规则的有效工作表名称。)
|
static void |
validateSheetName(java.lang.String sheetName)
Validates sheet name.
(验证工作表名称。)
|
public static java.lang.String createSafeSheetName(java.lang.String nameProposal)
Workbook.setSheetName(int, String)
.
nameProposal
- can be any string, will be truncated if necessary, allowed to be null
(nameProposal - 可以是任何字符串,必要时会被截断,允许为空)
public static java.lang.String createSafeSheetName(java.lang.String nameProposal, char replaceChar)
Workbook.setSheetName(int, String)
.
nameProposal
- can be any string, will be truncated if necessary, allowed to be null
(nameProposal - 可以是任何字符串,必要时会被截断,允许为空)
replaceChar
- the char to replace invalid characters.
(replaceChar - 用于替换无效字符的字符。)
public static void validateSheetName(java.lang.String sheetName)
The character count MUST be greater than or equal to 1 and less than or equal to 31. The string MUST NOT contain the any of the following characters:
sheetName
- the name to validate
(sheetName - 要验证的名称)
java.lang.IllegalArgumentException
- if validation fails
(java.lang.IllegalArgumentException - 如果验证失败)
Copyright 2021 The Apache Software Foundation or its licensors, as applicable.