summaryrefslogtreecommitdiff
path: root/core/string
diff options
context:
space:
mode:
authorAnilforextra <anilforextra@gmail.com>2022-02-03 21:48:38 +0545
committerAnilforextra <anilforextra@gmail.com>2022-02-04 01:28:02 +0545
commitadbe948bda202209b55249198e1837324e703ddb (patch)
treea7f424318e1d944e0564edb6fc55e8eabf266bd0 /core/string
parentbf12719ccabcea9bf9b274f77511e02581678774 (diff)
String: Add contains().
Diffstat (limited to 'core/string')
-rw-r--r--core/string/ustring.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/core/string/ustring.h b/core/string/ustring.h
index 6df87280a4..b685e3929f 100644
--- a/core/string/ustring.h
+++ b/core/string/ustring.h
@@ -394,6 +394,8 @@ public:
Vector<uint8_t> sha256_buffer() const;
_FORCE_INLINE_ bool is_empty() const { return length() == 0; }
+ _FORCE_INLINE_ bool contains(const char *p_str) const { return find(p_str) != -1; }
+ _FORCE_INLINE_ bool contains(const String &p_str) const { return find(p_str) != -1; }
// path functions
bool is_absolute_path() const;