(startIndex = 0, endIndex = 1, options?: { inplace?: boolean })
| 640 | */ |
| 641 | substring(startIndex: number, endIndex: number, options?: { inplace?: boolean }): Series |
| 642 | substring(startIndex = 0, endIndex = 1, options?: { inplace?: boolean }): Series | void { |
| 643 | const { inplace } = { inplace: false, ...options } |
| 644 | const newArr: Array<string | number> = []; |
| 645 | this.values.map((val) => { |
| 646 | if (utils.isEmpty(val)) { |
| 647 | newArr.push(NaN); |
| 648 | } else { |
| 649 | newArr.push(`${String(val).substring(startIndex, endIndex)}`); |
| 650 | } |
| 651 | }); |
| 652 | if (inplace) { |
| 653 | this.series.$setValues(newArr as ArrayType1D) |
| 654 | this.series.print() |
| 655 | } else { |
| 656 | const sf = this.series.copy() |
| 657 | sf.$setValues(newArr as ArrayType1D) |
| 658 | return sf; |
| 659 | } |
| 660 | } |
| 661 | |
| 662 | /** |
| 663 | * Removes whitespace from both ends of a string |
no test coverage detected