5.0.0 ā€¢ Published 1 year ago

trim-newlines v5.0.0

Weekly downloads
14,353,777
License
MIT
Repository
github
Last release
1 year 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_sample@geeky-apo/react-native-advanced-clipboardka-flow.jskafirchain-tetriskysol2forlernahelp-widgethong1-utilskhaled-salem-custom-componentsgogency-test-2gogencyguektorvinfolapture-ui-complaptureuilazy-bee-uijahancli_calculatorjamuskalimjeuxuijordy-frijters-test-libload-optsngrx-undo-v2markup-itmiracle-webpack-tree-shakingjsdoc-mdjrennsoh88-react-native-scroll-indicatorjson-to-foldericons-vue-testnative-date-picker-modulenative-modal-damage-vehiclenative-kakao-loginnative-google-loginnative-apple-loginneural_compressor_ext_lab_customizedneural_compressor_ext_lab_customized_2new-awesome-4321luojia-cli-devmeow-emekametalsmith-migrate-safetagmiguelcostero-ng2-toastymama-exporternodeqbnpm_qwertynpm_one_12_34_1_npm_one_1_2_3npm_one_2_2md-vditormediumpostscardjawwy_library_newjawy_library_v1gamification-jawwy-libraryframework_test_library_sixdee_new_jawwyibraz-calculatorzzzxxxyyy321123@bee-icons/qwikeditor.js-custom-multiple-selectededitorjs_forkedec0lint-style-config-postcss
4.1.0

1 year ago

5.0.0

1 year ago

4.1.1

1 year ago

3.0.1

3 years ago

4.0.1

3 years ago

4.0.2

3 years ago

4.0.0

3 years ago

3.0.0

5 years ago

2.0.0

7 years ago

1.0.0

9 years ago