split () method string interception

Split (); string into a character string dividing method

STR = ABC var | 123fgh;
str.split ( "|");
$ ( "# A") text (STR [0]); // value:. ABC
$ ( "# B) .text (STR [. 1 ]); // value: 123fgh

**********************************************

var newPrice = 30.08 | [4S Store] Poly Automobile Co. Shanghai;
// 30.08 method taken out of
newPrice.split ( "|") [0 ]; // taken out 30.08
newPrice.split ( "|",. 1); // to take out 30.08

Guess you like

Origin blog.csdn.net/yijiupingfan0914/article/details/93741598