JavaScript Tutorial For Beginners #25 - Slice and Split Strings

preview_player
Показать описание
Yo ninjas, I just want to show you a couple of neat little string methods (functions) in this JavaScript tutorial. The slice method and the split method. The slice method literally 'slices' your string into a new segment defined by starting and ending points. The split method, splits a string into multiple 'pockets' and puts them into an array (great for splitting tags).

As always, any questions, fire away below :).

========== JavaScript for Beginners Playlist ==========

========== CSS for Beginners Playlist ==========

========== HTML for Beginners Playlist ==========

========== The Net Ninja ============

========== Social Links ==========

Рекомендации по теме
Комментарии
Автор

I love how short and simple these vids are. Thanks

AllenZitting
Автор

This tutorial made me hungry for prok~!
But, f'reals though, you and the tutorials you make are awesome!
A very nice balance of thorough, to-the-point lecturing, and light-hearted feels.
Please keep doing what you do! <3

etymol
Автор

I actually was planning to use split, so searched that in YouTube. But while watching this video, I realised slice is more fitting for my purpose. Cheers!

TheHappyKamper
Автор

This channel is so great, you explain so simple and nietly!

cristianfz
Автор

<script>
var spy = "I was loving you"

var spy2 = spy.slice(0);

var spy3 = spy2.slice(6);

document.write(spy3 + " daily NetNinja");
</script>

aqeemjones
Автор

I like how you just jump into the subject matter.

clintona
Автор

Im eating a cake while watching this video and I can really taste the layer! Okay i'll stop...

mrcoder
Автор

sure feeling like having a little prok right now!

toxxicpit
Автор

Cannot read property 'slice' of null

this is printing on my developers tool

ChristianCanlubo
Автор

Can some one guide me how can i slice a specific string of array which includes number in it

harishtg
Автор

when we put slice(2, 9) then why 2nd digit is included and 9th one is not to be. In str2.

shivankmittal
Автор

You save me <3
tagsarray[0] =meat
tagsarray[1] =ham
tagsarray[2] =salami
All love!

medamiinlechlech
Автор

this video was uploaded on my birthdate. nice

ashishupadhyay
Автор

is the mozilla page link in description missing.

gokulk
Автор

Hi, and what is when i want to slice the string from backwards?

tamasdenes
Автор

How can we strip out the leading spaces from array positions >0?

BennyPowers
Автор

var t="rup, vars, abhi, sai, ana" this is the statment i wrote
i got 'rup, vars, abhi, sai, ana'(getting in single quotes ' ')
hope i will get the answer.

ziqtkbq
Автор

Hello,
how can I split a string without using the split function? What is the basic function for it?

teddybear
Автор

16 dislikers are the ones who split strings to "llo, wo"

batumanav
Автор

HEY NET NINJA, how do i split let alphabet = "abcdefghijklmnopqrstuvwxyz" into a single character with space [let alphabet1= alphabet.split(" ") ; ] is not working

kalamashaka