I am trying to understand somethings in a function to do with Show
I do know that it is to get the names of the days on a calendar. I have a calendar I built which I use
And would like to use the code above. But when I do, it has 7 >>> the basic difference between them is..... \n is use in c++ whereas <br/> is use in html ......however they both do they same work .....
\n is a special character, br is html tag
/n is used inside a String and it means end of line FYI: https://en.wikipedia.org/wiki/Newline <br> This will show up as a new line when HTML is rendered in a browser. FYI: https://www.w3schools.com/tags/tag_br.asp
\n works in PHP, Js and C++ <br> in html
To elaborate on the above in how they are applied specifically in Javascript, \n will be useful in your code which just utilizes JavaScript and the console. Whereas <br/> will be useful when you are calling upon the DOM to write Javascript mixed with HTML.
0 points over 8 years Im not understanding why
Answer 53335afd52f863787c000206Although experimentation could have revealed this answer, the
underlying function of What you are seeing is common in all programming languages and is called an Escape Sequence. When you are printing strings you may oftentimes want to manipulate the way the text displays, or more crucially, include characters that would normally break the code (including quotation marks within the string for instance). To accomplish these tasks with little hassle you begin with a backslash ( \ ) within the string, which in essence tells the compiler “Stop! The upcoming text is special.” In the example provided we use the
So if I wanted to print the string This is a “string” with troublesome\reactive characters! I could use the code points over 8 years Answer 52f4f16c80ff33af9a001b49Be curious. Experiment. Try removing the points over 8 years Answer 54385c5952f8638484000120i understand the concept, now (thanks Matthew), but removing the n (and in fact, entering in a number of these codes after /)doesnt make any difference in how it displays. could it be my browser? points almost 8 years Answer 5603d05d3e0ec85ed3000544as it seems /n adds a new line as Mathew explained above, for instance you can replace #puts with #print by adding \n after the thing you want to #print points about 7 years Does \n work in JavaScript?The newline character is \n in JavaScript and many other languages. All you need to do is add \n character whenever you require a line break to add a new line to a string.
What is the basic difference between \n and \t?The \n symbol means literally new line. This will go to the start of the next new line. The \t symbol means add a tab (which is usually 4 spaces but can easily be 2 or 8 depending on the context). The \r symbol is no more used that often.
What does \t mean in HTML?\r\n is a newline and \t is a tab.
What is PHP \\ n?You can use the PHP newline characters \n or \r\n to create a new line inside the source code. However, if you want the line breaks to be visible in the browser too, you can use the PHP nl2br() function which inserts HTML line breaks before all newlines in a string.
|