(str = "", options?: { inplace?: boolean })
| 255 | */ |
| 256 | startsWith(str: string, options?: { inplace?: boolean }): Series |
| 257 | startsWith(str = "", options?: { inplace?: boolean }): Series | void { |
| 258 | const { inplace } = { inplace: false, ...options } |
| 259 | const newArr: Array<boolean | number> = []; |
| 260 | this.values.forEach((val) => { |
| 261 | if (utils.isEmpty(val)) { |
| 262 | newArr.push(NaN); |
| 263 | } else { |
| 264 | newArr.push(`${val}`.startsWith(str)); |
| 265 | } |
| 266 | }); |
| 267 | if (inplace) { |
| 268 | this.series.$setValues(newArr as ArrayType1D) |
| 269 | this.series.print() |
| 270 | } else { |
| 271 | const sf = this.series.copy() |
| 272 | sf.$setValues(newArr as ArrayType1D) |
| 273 | return sf; |
| 274 | } |
| 275 | } |
| 276 | |
| 277 | /** |
| 278 | * Checks whether a string ends with specified characters |
no test coverage detected