Files
codeql/java/ql/test/library-tests/JDK/jdk/StringMatch.java
2022-03-02 12:51:12 -05:00

36 lines
558 B
Java

public class StringMatch {
private static String STR = "the quick brown fox jumps over the lazy dog";
void a() {
STR.matches("[a-z]+");
}
void b() {
STR.contains("the");
}
void c() {
STR.startsWith("the");
}
void d() {
STR.endsWith("dog");
}
void e() {
STR.indexOf("lazy");
}
void f() {
STR.lastIndexOf("lazy");
}
void g() {
STR.regionMatches(0, "fox", 0, 4);
}
void h() {
STR.regionMatches(true, 0, "FOX", 0, 4);
}
}