Trim whitespace from the ends of a string.
Numeric.string.strip(text, mode = 'both')Trims characters from one or both ends.
- Parameters:
text: String or array of strings to trimmode: Side or sides that are trimmed
- Returns: Trimmed strings matching the input shape
- NumPy: Covers
np.strings.strip,np.strings.lstrip,np.strings.rstrip,np.char.strip,np.char.lstrip,np.char.rstripthrough a single Numerix method.
import Numeric from '@neabyte/numerix'
const value = Numeric.string.strip(' ab ')
console.log(value)
// abimport Numeric from '@neabyte/numerix'
const value = Numeric.string.strip(' ab ', 'left')
console.log(value)
// abimport Numeric from '@neabyte/numerix'
const value = Numeric.string.strip(' ab ', 'right')
console.log(value)
// abimport Numeric from '@neabyte/numerix'
const values = Numeric.string.strip([' a ', ' b '])
console.log(values)
// ["a","b"]