From 89b1ed926341d68c7e2b575e793e36a4805dd421 Mon Sep 17 00:00:00 2001 From: Relintai Date: Mon, 8 Aug 2022 16:06:34 +0200 Subject: [PATCH] Ported contains for String from Godot4. --- core/ustring.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/ustring.h b/core/ustring.h index 9ac042aeb..13c297507 100644 --- a/core/ustring.h +++ b/core/ustring.h @@ -31,10 +31,10 @@ /*************************************************************************/ #include "core/array.h" +#include "core/char_utils.h" #include "core/cowdata.h" #include "core/typedefs.h" #include "core/vector.h" -#include "core/char_utils.h" template class CharProxy { @@ -346,6 +346,8 @@ public: Vector sha256_buffer() const; _FORCE_INLINE_ bool 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_abs_path() const;