I have a string as follows-
roger::)
I need to split into two string as roger
and :)
. I am using the following
"roger::)".split(":")
But this forms three array elements,namely roger
,[empty]
and )
although what i need is two array elements as roger
and :)
.
I tried using the following link but the console prints undefined
for "roger::)".split(/_(.+)?/)[1]
Please Help.