https://github.com/seregpie/xlsx.utils.sanitize_sheet_name
Sanitizes a string to be safe for the use as a sheet name by removing the invalid characters and limiting the length.
https://github.com/seregpie/xlsx.utils.sanitize_sheet_name
Last synced: about 2 months ago
JSON representation
Sanitizes a string to be safe for the use as a sheet name by removing the invalid characters and limiting the length.
- Host: GitHub
- URL: https://github.com/seregpie/xlsx.utils.sanitize_sheet_name
- Owner: SeregPie
- License: mit
- Created: 2018-07-13T12:55:04.000Z (almost 7 years ago)
- Default Branch: main
- Last Pushed: 2021-03-19T16:00:30.000Z (about 4 years ago)
- Last Synced: 2025-03-29T05:01:42.263Z (about 2 months ago)
- Language: JavaScript
- Homepage:
- Size: 1.95 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# XLSX.utils.sanitize_sheet_name
`XLSX.utils.sanitize_sheet_name(data)`
Sanitizes a string to be safe for the use as a sheet name by removing the invalid characters and limiting the length.
## setup
### npm
```shell
npm i xlsx.utils.sanitize_sheet_name
```---
Import inside an ES module.
```javascript
import 'xlsx.utils.sanitize_sheet_name';
import XLSX from 'xlsx';
```*or*
Import inside a CommonJS module.
```javascript
require('xlsx.utils.sanitize_sheet_name');
let XLSX = require('xlsx');
```### browser
```html
```
## usage
```javascript
let sheetName = XLSX.utils.sanitize_sheet_name('Yes/No? [*2]');
// => 'YesNo 2'
```