Hi Friends đź‘‹,
Welcome to Infinitbility ❤️!
Today, we are going to learn How to convert string to char array in typescript, here we will use built-in method .split()
to convert string to array.
Well, we have sample an string which we have to seprate and we have to pick those data and use as array.
To do this things, we have built-in method .split()
which we have to provide empty string seprator for to seprate every string char element.
let’s dive in code…
1let brandStr: string = 'Infinitbility';23// lets convert it in array4let brandArray: Array<string> = brandStr.split("");56console.log(brandArray);
Well, when you run above code, you can able to see above string converted in char array.
For now, let’s check the output.
Output

All the best 👍.
Follow me on Twitter
Join our email list and get notified about new content
No worries, I respect your privacy and I will never abuse your email.
Every week, on Tuesday, you will receive a list of free tutorials I made during the week (I write one every day) and news on other training products I create.