(str = "", options?: { inplace?: boolean })
| 325 | */ |
| 326 | includes(str: string, options?: { inplace?: boolean }): Series |
| 327 | includes(str = "", options?: { inplace?: boolean }): Series | void { |
| 328 | const { inplace } = { inplace: false, ...options } |
| 329 | const newArr: Array<boolean | number> = []; |
| 330 | this.values.map((val) => { |
| 331 | if (utils.isEmpty(val)) { |
| 332 | newArr.push(NaN); |
| 333 | } else { |
| 334 | newArr.push(`${val}`.includes(str)); |
| 335 | } |
| 336 | }); |
| 337 | if (inplace) { |
| 338 | this.series.$setValues(newArr as ArrayType1D) |
| 339 | this.series.print() |
| 340 | } else { |
| 341 | const sf = this.series.copy() |
| 342 | sf.$setValues(newArr as ArrayType1D) |
| 343 | return sf; |
| 344 | } |
| 345 | } |
| 346 | |
| 347 | /** |
| 348 | * Returns the position of the first occurrence of a specified value in a string. |
no test coverage detected