Trim whitespace from the ends of a string.
Numeric.string.strip(input, which, chars)Trims characters from one or both ends.
- Parameters:
input: String or array of strings to trimwhich: Side or sides that are trimmedchars: Optional set of characters to strip
- 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)
// ab (followed by two spaces)import 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"]