Count the characters in a string.
Numeric.string.length(text)Counts characters in each string entry.
- Parameters:
text: String or array of strings to measure
- Returns: Character counts matching the input shape
- NumPy: Covers
np.strings.str_len,np.char.str_lenthrough a single Numerix method.
import Numeric from '@neabyte/numerix'
const value = Numeric.string.length('hello')
console.log(value)
// 5import Numeric from '@neabyte/numerix'
const values = Numeric.string.length(['a', 'abc'])
console.log(values)
// [1,3]import Numeric from '@neabyte/numerix'
const value = Numeric.string.length('')
console.log(value)
// 0import Numeric from '@neabyte/numerix'
const value = Numeric.string.length('a b')
console.log(value)
// 3