Answers for "js split a string at index"

1

javsacript split string at position

let hey="helloworld";
let index=5;
hey.substring(0, index);//hello
hey.substring(index);//world
Posted by: Guest on March-24-2022
1

js split at index

const splitAt = (index: number) => (x: string) => [x.slice(0, index), x.slice(index)]
Posted by: Guest on May-19-2021

Code answers related to "TypeScript"

Browse Popular Code Answers by Language