Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript split string only on first instance of specified character

'good_luck_buddy'.split(/_(.*)/s)
['good', 'luck_buddy', ''] // ignore the third element
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #javascript #split #string #instance #character
ADD COMMENT
Topic
Name
1+4 =