JS - Search for a value string, before its interception. And the value after

var str = "11:222";    

/*

* Interception ":" value before and after  

* /
Document.write (str.split ( ':') [0]) // output. 11
document.write (str.split ( ':') [. 1]) // Output 222

Guess you like

Origin www.cnblogs.com/500m/p/11429422.html