(str = "", options?: { inplace?: boolean })
| 502 | */ |
| 503 | search(str: string, options?: { inplace?: boolean }): Series |
| 504 | search(str = "", options?: { inplace?: boolean }): Series | void { |
| 505 | const { inplace } = { inplace: false, ...options } |
| 506 | const newArr: Array<string | number> = []; |
| 507 | this.values.map((val) => { |
| 508 | if (utils.isEmpty(val)) { |
| 509 | newArr.push(NaN); |
| 510 | } else { |
| 511 | newArr.push(`${val}`.search(str)); |
| 512 | } |
| 513 | }); |
| 514 | if (inplace) { |
| 515 | this.series.$setValues(newArr as ArrayType1D) |
| 516 | this.series.print() |
| 517 | } else { |
| 518 | const sf = this.series.copy() |
| 519 | sf.$setValues(newArr as ArrayType1D) |
| 520 | return sf; |
| 521 | } |
| 522 | } |
| 523 | |
| 524 | /** |
| 525 | * Extracts a part of a string and returns a new string |
no test coverage detected