String Split for only first time

Viewed 84

I want to split the below input string as output string.
Input = 'ABC1:ABC2:ABC3:ABC4'
Output = ['ABC1','ABC2:ABC3:ABC4']

let a = 'ABC1:ABC2:ABC3:ABC4'
a.split(':', 2); // not working returning ['ABC1','ABC2']
4 Answers
Related