Js intercepts two kinds of method of string and distinction detailed explanation

  • 2020-03-26 23:03:40
  • OfStack

Var long2 = "1988-0 w - 07";

Alert (long2. Substring (0, 4) + "-- -- -- -- -- -" + long2. Substring (5, 6));     1988 -- -- -- -- -- - 0

Alert (long2. Substr (0, 4) + "-- -- -- -- -- -" + long2, substr (5, 2));                       1988-0 w

Coordinates   when substring is intercepted; Including the front   Not including the back


Related articles: