Browse Source

Added HasMultibyteChars properties

Brian Fiete 10 months ago
parent
commit
c12c1bf9f9
1 changed files with 27 additions and 0 deletions
  1. 27 0
      BeefLibs/corlib/src/String.bf

+ 27 - 0
BeefLibs/corlib/src/String.bf

@@ -2745,6 +2745,20 @@ namespace System
 			return UTF8Enumerator(Ptr, startIdx, mLength);
 		}
 
+		public bool HasMultibyteChars
+		{
+			get
+			{
+				char8* ptr = Ptr;
+				int len = Length;
+				for (int i < len)
+					if (ptr[i] >= '\x80')
+						return true;
+				return false;
+			}
+		}
+
+		[Obsolete("HasMultibyteChars() method has been replaced with the HasMultibyteChars property")]
 		public bool HasMultibyteChars()
 		{
 			char8* ptr = Ptr;
@@ -3707,6 +3721,19 @@ namespace System
 			}
 		}
 
+		public bool HasMultibyteChars
+		{
+			get
+			{
+				char8* ptr = Ptr;
+				int len = Length;
+				for (int i < len)
+					if (ptr[i] >= '\x80')
+						return true;
+				return false;
+			}
+		}
+
 		public int GetHashCode()
 		{
 			return String.[Friend]GetHashCode(mPtr, mLength);