Answers for "js split string with emoji"

1

js split string with emoji

function splitStringAtIndex(value: string, index: number) {
  const arr = [...value] // Fix emojis

  return [arr.slice(0, index).join(''), arr.slice(index).join('')]
}
Posted by: Guest on February-01-2022

Code answers related to "TypeScript"

Browse Popular Code Answers by Language