List of Escape Sequence :
\’ single quote
\” double quote
\\ backslash
\n newline
\b backspace
\r carriage return
\t horizontal tab
\v vertical tab
\u Unicode
We have some situations where we don’t need to execute escape chars.
Windows OS Paths
Regular Expressions.
Example:
print(“c:\users\narendra\blog”)
Solution:
print(“c:\\users\\narendra\\blog”)
print(r“c:\users\narendra\blog”)
print(R“c:\users\narendra\blog”)
Raw String is represented with r’followdByString’
Raw String do not execute escape sequence instead it treats them a literal.
Note: There is no problem with Linux Paths while working with escape sequence
Watch video Escape Sequence Characters and Raw String Usage with \n \b \r \t \v and \u | Vidoe - 13 online without registration, duration hours minute second in high quality. This video was added by user VRTechnologies For Automation 26 October 2020, don't forget to share it with your friends and acquaintances, it has been viewed on our site 828 once and liked it 17 people.