What is a String?
When it comes to concepts, I like to explain them to my son when I play with him, but in his terms, as he is 6.
To conclude this analogy we could say that a string is a group of letters combined to create a specific message, and in programming, we use strings to communicate to the computer what we want to do.
4 Types of String
The escape character. Using a traditional string, we would need to use the escape character and write the string as "Someone\nElse". The \n will not only be much more readable and easier to work with, but it will also add a break and our code will be like this now: ”Someone Else”
A string is a single character: a single letter, phrase, or even paragraph.
• It is wrapped up into a single quotation or double quotation
• When a word contained within the paragraph or phrase has a quotation it will interfere with the string as its matches the string.
• Examples of solutions are to use 1) a single quotation for the word with the phrase wrapped in the double quotation, or 2) using escape.
• A backslash followed by n will make a break the word like this: someone else
• The most versatile solution is the use of the Template Strings that consist of a backtick (`)
That's it for the first article out of 6