About 53 results
Open links in new tab
  1. string - javascript substring - Stack Overflow

    Apr 4, 2013 · You're confusing substring() and substr(): substring() expects two indices and not offset and length. In your case, the indices are 5 and 2, ie characters 2..4 will be returned as the higher …

  2. javascript - What is the difference between substr and substring ...

    Sep 19, 2010 · As hinted at in yatima2975's answer, there is an additional difference: substr() accepts a negative starting position as an offset from the end of the string. substring() does not, but slice() …

  3. How to grab substring before a specified character in JavaScript?

    How to grab substring before a specified character in JavaScript? Asked 14 years ago Modified 1 year, 1 month ago Viewed 726k times

  4. How can I cut a substring from a string to the end using Javascript ...

    9 This may be new, but the substring method returns everything from a specified index to the end of the string.

  5. javascript - What is the difference between String.slice and String ...

    Feb 11, 2010 · Distinctions of substring(): If start > stop, then substring will swap those 2 arguments. If either argument is negative or is NaN, it is treated as if it were 0. Distinctions of slice(): If start > stop, …

  6. javascript - Qual é a diferença entre substr () e substring ()? - Stack ...

    A diferença é que o substr trabalha com quantidades de caracteres (especificada ou não no segundo parâmetro) a partir de uma posição index (índice) da string (especificada no primeiro parâmetro), …

  7. javascript - How to use substring () when the string has a space in it ...

    Jun 14, 2016 · 4 I have a string containing a person's first and last name such as John Doe. I would like to convert this string to John D. Normally, I would just use substring(0,1) on the last name variable, …

  8. How to replace substring in Javascript? - Stack Overflow

    Nov 27, 2016 · How to replace substring in Javascript? Asked 15 years, 1 month ago Modified 5 years, 1 month ago Viewed 50k times

  9. Get Substring between two characters using JavaScript

    Feb 14, 2013 · Get Substring between two characters using JavaScript Asked 12 years, 11 months ago Modified 1 year, 7 months ago Viewed 628k times

  10. How to get substring after last specific character in JavaScript ...

    Jan 20, 2016 · I have a string test/category/1. I have to get substring after test/category/. How can I do that?