![]() \f inserts a formfeed at the point of usage in the text. carriageReturnExample uses \r and the output shows that the part after the \r character goes to the new line and starts from the beginning. It just goes to the beginning of the line and then prints the remaining part of the string. \r inserts a carriage return at the point where it is being used. newLineExample is a complete string, but when we use \n, the output shows that a part of the string goes into the new line. \n inserts a new line at the point in the text where it is being used. ![]() backspaceExample uses \b, and the extra space between the words has been removed as seen in the output. \b inserts a backspace or can say that it removes the character behind it. In the following example, tabExample has a string with \t escape sequence between two words. It can be used when we want to show something in a different section. ![]() \t inserts a tab or a large space in the text at the point where it is used. Note that some compilers may give different or unusual results. In the above section, we saw the short descriptions of the various escape sequences now we will discuss these escape characters with an example. AngularJS CRUD Application- A Handy App in 30 minutes Escape Sequence Description \t A tab \b A backspace \n A new line character \r A carriage return \f A form feed \' A single quote \" A double quote \\ A backslash character Escape Sequences in Java and How to Use Them
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |