String: Add contains().

This commit is contained in:
Anilforextra 2022-02-03 21:48:38 +05:45
parent bf12719cca
commit adbe948bda
57 changed files with 142 additions and 119 deletions

View file

@ -99,11 +99,11 @@ Error RDShaderFile::parse_versions_from_text(const String &p_text, const String
if (reading_versions) {
String l = line.strip_edges();
if (!l.is_empty()) {
if (l.find("=") == -1) {
if (!l.contains("=")) {
base_error = "Missing `=` in '" + l + "'. Version syntax is `version = \"<defines with C escaping>\";`.";
break;
}
if (l.find(";") == -1) {
if (!l.contains(";")) {
// We don't require a semicolon per se, but it's needed for clang-format to handle things properly.
base_error = "Missing `;` in '" + l + "'. Version syntax is `version = \"<defines with C escaping>\";`.";
break;