(startIndex = 0, endIndex = 1, options?: { inplace?: boolean })
| 538 | */ |
| 539 | slice(startIndex: number, endIndex: number, options?: { inplace?: boolean }): Series |
| 540 | slice(startIndex = 0, endIndex = 1, options?: { inplace?: boolean }): Series | void { |
| 541 | const { inplace } = { inplace: false, ...options } |
| 542 | const newArr: Array<string | number> = []; |
| 543 | this.values.map((val) => { |
| 544 | if (utils.isEmpty(val)) { |
| 545 | newArr.push(NaN); |
| 546 | } else { |
| 547 | newArr.push(`${val}`.slice(startIndex, endIndex)); |
| 548 | } |
| 549 | }); |
| 550 | if (inplace) { |
| 551 | this.series.$setValues(newArr as ArrayType1D) |
| 552 | this.series.print() |
| 553 | } else { |
| 554 | const sf = this.series.copy() |
| 555 | sf.$setValues(newArr as ArrayType1D) |
| 556 | return sf; |
| 557 | } |
| 558 | } |
| 559 | |
| 560 | /** |
| 561 | * Splits a string into an values of substrings |
no test coverage detected