✂️ Extracting Sub-Strings In JavaScript Using SubString, Substr and Slice 🔪

Veröffentlicht am: 07 Mai 2018
auf dem Kanal: Love2Dev
203
4

Manipulating data is an important part of any application. As JavaScript has gained more market share the need to use the language to parse and extract data has risen.

pizza-sliceJavaScript has native members of the String object to help extract sub-strings based on character position: substring, substr and slice. Each return a string, extracted from an initial string based on start position and a length.

On the surface they look almost identical, but have some subtle differences.

substring(indexStart[, indexEnd]): returns the part of the string between the start and end indexes, or to the end of the string.
substr(start[, length]): returns the part of a string between the start index and a number of characters after it.
slice(beginIndex[, endIndex]): extracts a section of a string and returns it as a new string.

Read the Blog Post - https://love2dev.com/blog/javascript-...

Get social with Love2Dev on:
Facebook:   / love2dev  
Twitter:   / chrislove  
G+: https://plus.google.com/b/11090410738...
Linkedin:   / love2dev  
Pinterest:   / docluv  


Auf dieser Seite können Sie das Online-Video ✂️ Extracting Sub-Strings In JavaScript Using SubString, Substr and Slice 🔪 mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Love2Dev 07 Mai 2018 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 203 Mal angesehen und es wurde von 4 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!