Series.str.startsWith

Test whether a string begins with specified characters

danfo.Series.str.startsWith(str) [source]

Parameters

Type

Description

Default

str

string

the character(s) to check

""

Returns: Series (Boolean element)

Examples

Node
Browser
Node
const dfd = require("danfojs-node")
let data = ['lower', 'CAPITALS', 'this is a sentence', 'SwApCaSe']
let sf = new dfd.Series(data)
sf.str.startsWith("S").print()
Browser
Output
Output
╔═══╤══════════════════════╗
║ │ 0 ║
╟───┼──────────────────────╢
║ 0 │ false ║
╟───┼──────────────────────╢
║ 1 │ false ║
╟───┼──────────────────────╢
║ 2 │ false ║
╟───┼──────────────────────╢
║ 3 │ true ║
╚═══╧══════════════════════╝