About 52 results
Open links in new tab
  1. 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() …

  2. 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 …

  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, 2 months ago Viewed 726k times

  4. 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, …

  5. 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), …

  6. 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.

  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. Get Substring between two characters using JavaScript

    Feb 14, 2013 · The best solution I have came up with to work on multiple projects is using four methods inside an object. First method: is to actually get a substring from between two strings (however it will …

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

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

  10. javascript - Substring arguments best practice - Stack Overflow

    Dec 15, 2009 · The JavaScript String object has two substring functions substring and substr. substring takes two parameters beginIndex and endIndex. substr also takes two parameters beginIndex and …