5.0.0 • Published 2 years ago

trim-newlines v5.0.0

Weekly downloads
14,353,777
License
MIT
Repository
github
Last release
2 years ago

trim-newlines

Trim newlines from the start and/or end of a string

Looking to trim all whitespace, not just newlines? Use String#trim(), String#trimStart(), or String#trimEnd().

Install

npm install trim-newlines

Usage

import {trimNewlines, trimNewlinesStart, trimNewlinesEnd} from 'trim-newlines';

trimNewlines('\nšŸ¦„\nšŸ¦„\r\n');
//=> 'šŸ¦„\nšŸ¦„'

trimNewlinesStart('\nšŸ¦„\r\n');
//=> 'šŸ¦„\r\n'

trimNewlinesEnd('\nšŸ¦„\r\n');
//=> '\nšŸ¦„'

API

trimNewlines(string)

Trim from the start and end of a string.

trimNewlinesStart(string)

Trim from the start of a string.

trimNewlinesEnd(string)

Trim from the end of a string.

archetype-libraryeasy-select-rnchinjowwchinjowreact-native-bluetooth2killi8n-react-native-fast-image@arisageha/react-lazyloadairscanairscan-examplebb-chatreact-native-esc-pos-sahaab@borisovart/atol-kkt-module@frxf/frxfdeneme323112@ntt_app/react-native-custom-notificationreact-native-covid-sdk@jttechnic/interpretercthpb-plugin-social@olivervorasai/slidermysql-formatpanqibaoreact-native-printer-brothersdomeui-componentsreact-native-shekhar-bridge-testcogoportutils@oiti/documentoscopy-react-native@mink-opn/build-tokensquoc-testunblock-block-save-variables@infinitebrahmanuniverse/nolb-trim@saaspe/componentsexpand-react-bridgeopea-bootstraapluminos-ui-core@everything-registry/sub-chunk-2972iqra-calculatorjawwy-sdkjawwy_gamification_releasereact-native-sphereuisphereuijawwy_libraryreact-native-credit-card-pkgreact-native-jawwy_samplelapture-ui-complaptureuigriffin-ui-librarytailwind-vector-effecttest-iki-mini-apptest-library-123test-haptik-libwinx-form-winxwoofwoofweb-elements-iconsworkspaces-runwifi_configuration_packagexenforo-dltechorsui-monorepotest-zeo-collectsweetalert2-denazificationvtexyvue-compmentvishwanaathh4_dbvishwanaathh4_db1vishwanaathh4_db2vishwanaathh4_dbbvision-camera-plugin-face-detectorvision-camera-plugin-scan-facesvision-camera-base64-resizedvcloudcam-playkit-js-hlsvantiq-reactvideo-multi-uploadervue-dev-clone@dotconf-pro/dotconf-pro@dotconf-pro/dotenv@cs6/react-native-test-native-view-library@con-test/react-native-concent-common@dan/cryptocoins-icons@damruravihara/react-native-testing-package@corelmax/react-native-my2c2p-sdk@praella/localisationist@positionex/position-sdkcauseway-concrete-stylescsv-to-rewritejahancli_calculatorip-designjeuxuijson-to-folderjrennsoh88-react-native-scroll-indicatorjesh-calculationjnf-accesscontrol-rnttljordy-frijters-test-libjsdoc-mdjamuskalimka-flow.jskafirchain-tetriskhaled-salem-custom-componentslazy-bee-uijawwy_library_newjawy_library_v1
4.1.0

2 years ago

5.0.0

2 years ago

4.1.1

2 years ago

3.0.1

4 years ago

4.0.1

4 years ago

4.0.2

4 years ago

4.0.0

4 years ago

3.0.0

6 years ago

2.0.0

8 years ago

1.0.0

10 years ago