Escape sequences java tutorial

broken image

It's also possible to select no escape character by writing ESCAPE ''. See Section 4.1.2.1 for more information. If you have standard_conforming_strings turned off, any backslashes you write in literal string constants will need to be doubled.

broken image

To match the escape character itself, write two escape characters. The default escape character is the backslash but a different one can be selected by using the ESCAPE clause. To match a literal underscore or percent sign without matching other characters, the respective character in pattern must be preceded by the escape character. Therefore, if it's desired to match a sequence anywhere within a string, the pattern must start and end with a percent sign. LIKE pattern matching always covers the entire string. An underscore ( _) in pattern stands for (matches) any single character a percent sign ( %) matches any sequence of zero or more characters. If pattern does not contain percent signs or underscores, then the pattern only represents the string itself in that case LIKE acts like the equals operator. An equivalent expression is NOT ( string LIKE pattern).)

(As expected, the NOT LIKE expression returns false if LIKE returns true, and vice versa. The LIKE expression returns true if the string matches the supplied pattern.

broken image