removeSpaces

Returns a new string with the 'suffix' removed, if present.

Install

Install all functions of strman

yarn add strman

or just the removeSpaces function

yarn add strman.removespaces

Usage

import { removeSpaces } from 'strman'
// OR
import removeSpaces from 'strman.removespaces'
Parameters:
Name Type Attributes Default Description
value String

The String!

suffix String

String to remove on right.

caseSensitive Boolean <optional>
true

If you need to caseSensitive.

Source:
Returns:

The String without suffix!

Type
String
Example
const title = 'strman'
removeRight(title, 'man')
// => 'str'
Parameters:
Name Type Description
value String

The String!

replaced String

Value to replace.

Source:
Returns:

String without spaces.

Type
String
Example
const title = '  s t r  m  a n     '
removeSpaces(title)
// => 'strman'

Remove all spaces and replace for value.

Install

Install all functions of strman

yarn add strman

or just the removeSpaces function

yarn add strman.removespaces

Usage

import { removeSpaces } from 'strman'
// OR
import removeSpaces from 'strman.removespaces'
Parameters:
Name Type Attributes Default Description
value String

The String!

suffix String

String to remove on right.

caseSensitive Boolean <optional>
true

If you need to caseSensitive.

Source:
Returns:

The String without suffix!

Type
String
Example
const title = 'strman'
removeRight(title, 'man')
// => 'str'
Parameters:
Name Type Description
value String

The String!

replaced String

Value to replace.

Source:
Returns:

String without spaces.

Type
String
Example
const title = '  s t r  m  a n     '
removeSpaces(title)
// => 'strman'