const str = "My name is learn javascript";
Split this string using space and find length.
Write a program to check if a string is palindrome or not?
9581444444 Convert to below
95814*****
*****44444
958**444**
Write a program to reverse a string. For example:
Hello -> olleH
Bye -> eyB
Captialize first character of the String. For example:
learnjavascript -> Learnjavascript
hello -> Hello
In a string convert uppercase character to lowercase and vice versa.
HeLlo -> hElLO
leArNjavaScript -> LEaRnJAVAsCRIPT
Camelize the string. for example:
Hello World -> helloWorld
my name is Sajid -> myNameIsSajid
learn javascript -> learnJavascript
Count number of spaces in a string.
Print below pattern using repeat function:
1111111111
222222222
33333333
4444444
555555
66666
7777
888
99
0
"My name is Sajid Khan", take input from user and print whatever is there after the word. For example:
Hello learn javascript
input: "rn"
output: javascipt
Write differences between substring vs slice vs substr methods.
What is Regex ? Give examples.
Write difference between match vs search functions.
Take a sentence using prompt box. In next question ask for a string and check if that string is present in that sentence or not.
Take a string and if in that string anything is there other than the characters $, _, number, a-z, A_Z then remove them from the string. Do it with regex and without regex. for example:
We%^%$Cod!@#e -> We$Code