| 572 | */ |
| 573 | split(splitVal: string, options?: { inplace?: boolean }): Series |
| 574 | split(splitVal = " ", options?: { inplace?: boolean }): Series | void { |
| 575 | const { inplace } = { inplace: false, ...options } |
| 576 | const newArr: Array<string | number> = []; |
| 577 | this.values.map((val) => { |
| 578 | if (utils.isEmpty(val)) { |
| 579 | newArr.push(NaN); |
| 580 | } else { |
| 581 | newArr.push(`${String(val).split(splitVal)}`); |
| 582 | } |
| 583 | }); |
| 584 | if (inplace) { |
| 585 | this.series.$setValues(newArr as ArrayType1D) |
| 586 | this.series.print() |
| 587 | } else { |
| 588 | const sf = this.series.copy() |
| 589 | sf.$setValues(newArr as ArrayType1D) |
| 590 | return sf; |
| 591 | } |
| 592 | } |
| 593 | |
| 594 | /** |
| 595 | * Extracts the characters from a string, beginning at a specified start position, and through the specified number of character |