Test whether a string starts with a prefix.
Numeric.string.prefix(text, start)Checks the beginning of each string entry.
- Parameters:
text: String or array of strings to teststart: Prefix expected at the beginning
- Returns: Match results matching the input shape
- NumPy: Covers
np.strings.startswith,np.char.startswiththrough a single Numerix method.
import Numeric from '@neabyte/numerix'
const flag = Numeric.string.prefix('hello', 'he')
console.log(flag)
// trueimport Numeric from '@neabyte/numerix'
const flag = Numeric.string.prefix('hello', 'lo')
console.log(flag)
// falseimport Numeric from '@neabyte/numerix'
const flag = Numeric.string.prefix('hello', '')
console.log(flag)
// trueimport Numeric from '@neabyte/numerix'
const flags = Numeric.string.prefix(['hello', 'world'], 'he')
console.log(flags)
// [true,false]