4 lines
195 B
TypeScript
4 lines
195 B
TypeScript
export function splitByIndexes(input: string, indexes: number[]): string[] {
|
|
const parts = input.split('_');
|
|
return indexes.map((index) => parts[index]).filter((item) => item !== undefined);
|
|
}
|