How To Split a String In JavaScript

preview_player
Показать описание
In this tutorial, we'll take a really quick look at how you can split a string in Javascript with the split function.

The JavaScript split function which is used to split a string is really simple to use and speaks for itself in terms of what it can do. There are however a couple of parameters that you can pass in to the split function and it's important to know what they are and how to use them to achieve the result you are after.

In the tutorial, you'll learn about using the JavaScript split function to separate a sentence into words and how to handle multiple spaces. You'll also learn how to split a complete string into an array where each item in the array is one of the characters of the string. Finally, you'll see how to limit the result of the response of the split function and also join the array that is created back into a complete string.

#JavaScript #JavaScriptHowTos #JavaScriptFunctions Channel Handle @codebubb
Рекомендации по теме
Комментарии
Автор

Your voice is awesome. Great tutorial.

alwynjohn
Автор

How to solve this?
Write a JavaScript program that accepts two strings as user input. The program should determine the first occurrence of the second string within the first string. And then print into the console the second string along with the last remaining characters of the first string. Print the string in capital letters.

Sample Input:
“University”
“ver”


Sample output:
“VERSITY”

TheMarketingManU