(valToJoin = "", joinChar = " ", options?: { inplace?: boolean })
| 708 | */ |
| 709 | join(valToJoin: string, joinChar: string, options?: { inplace?: boolean }): Series |
| 710 | join(valToJoin = "", joinChar = " ", options?: { inplace?: boolean }): Series | void { |
| 711 | const { inplace } = { inplace: false, ...options } |
| 712 | const newArr: Array<string | number> = []; |
| 713 | this.values.map((val) => { |
| 714 | if (utils.isEmpty(val)) { |
| 715 | newArr.push(NaN); |
| 716 | } else { |
| 717 | let leftChar = val; |
| 718 | let rightChar = valToJoin; |
| 719 | let new_char = `${leftChar}${joinChar}${rightChar}`; |
| 720 | newArr.push(new_char); |
| 721 | } |
| 722 | }); |
| 723 | if (inplace) { |
| 724 | this.series.$setValues(newArr as ArrayType1D) |
| 725 | this.series.print() |
| 726 | } else { |
| 727 | const sf = this.series.copy() |
| 728 | sf.$setValues(newArr as ArrayType1D) |
| 729 | return sf; |
| 730 | } |
| 731 | } |
| 732 | |
| 733 | /** |
| 734 | * Counts the number of characters in string |
no test coverage detected