JavaScript String
/*STRING CONCATENATION, a process of combining two or more string or sentence into a single
string or sentence.
now, if you're writing string, you can actually type nothing on that string, i mean not really nothing
but you can just type a space on a string and it'll counted as a character on that string*/
//Example:
var message = "Hello";
var costumerName = "Aram";
/* in this case, you cant type space in the console log right? because all you need to do is just insert
the variable that you already make, but if you just do that
you will have a sentence without a space, so you can add a string on the [Link] but with just a
space character on the string.*/
[Link](message + " " + costumerName);
/* STRING LENGTH, a length of the character on a string */
//Example
var myName = "Aram";
[Link]([Link]); /* and it'll be showing 6 on the console because the character is 6 on
the string */
/* now i want to make a little excercise*/
var nameLength = prompt("Tell me anything and i will count the character that you've been typed");
alert([Link] + " characters out of 180, " + ("180" - [Link]) + " left." );
/* STRING SLICING, slicing a character on a string*/
//Example:
var name = "Aram";
[Link]([Link](0,1)); /*the console will be just showing F because the character selected is
between 0 to 1, and remember
programmers always count from zero, so based on the script before "F" is counted as 0 from the
start, and then the 1 used to give
a statement that it's stopping before 1 and the 1 is counted as "a" on the string, let give some more
example*/
//Example 2:
[Link]([Link](0,4)); /* it'll be showing only "Fakh" because the slicing is stopped before the
"r" character that counted as 4 */
// you also can slice it from the middle depends on the character you selected
//Example 3:
[Link]([Link](4,5)); /*the console will just be showing "r" because the "r" is counted as 4
on the string, and it stopped before "y" that counted as 5*/
[Link]([Link](0,180)); /*the console will show you the character that's counted from
0 to 179 based on what you input on the prompt.
Or you can just put the prompt into the [Link] and it'll just working like the same. Example =
[Link](prompt("Tell me anything and i will count the character that you've been
typed").slice(0,180); */
/*toUpperCase(), changing a;; pf the characters of the string to a uppercase*/
[Link]([Link]()); // just like that. Now i'll get up some excercise using this script.
//Excercise:
var newName = prompt("Tell me your name"); //this will make a variable by an input
var sliceName = [Link](0,1)// and we'll slice up the first character of the input
var lowerName = [Link](1, [Link]);// after that we need the rest except the first
character
alert("Hello " + [Link]() + [Link]());// and making the first
character an uppercase and the rest is lowercase