Kebab file names

This commit is contained in:
Angelos Chalaris
2023-04-27 21:58:35 +03:00
parent 1d189c709a
commit 61200d90c4
440 changed files with 0 additions and 0 deletions

View File

@ -0,0 +1,20 @@
---
title: Remove whitespaces
tags: string,regexp
cover: tropical-bike
firstSeen: 2020-10-13T09:37:17+03:00
lastUpdated: 2020-11-03T21:46:13+02:00
---
Returns a string with whitespaces removed.
- Use `String.prototype.replace()` with a regular expression to replace all occurrences of whitespace characters with an empty string.
```js
const removeWhitespace = str => str.replace(/\s+/g, '');
```
```js
removeWhitespace('Lorem ipsum.\n Dolor sit amet. ');
// 'Loremipsum.Dolorsitamet.'
```