DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
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
COMMENT
Name
4+4 =
Submit