From afc8832facbd262f0260c951d35ce67ef3dafc92 Mon Sep 17 00:00:00 2001
From: MadCode1982 <528764698@qq.com>
Date: Tue, 3 Sep 2024 12:30:31 +0800
Subject: [PATCH] Update InternalBitConverter.cs

fixed  text.IndexOf("\0") return 0 in .net core
---
 Common/StructuredStorage/Common/InternalBitConverter.cs | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/Common/StructuredStorage/Common/InternalBitConverter.cs b/Common/StructuredStorage/Common/InternalBitConverter.cs
index 4f88379..baaea83 100644
--- a/Common/StructuredStorage/Common/InternalBitConverter.cs
+++ b/Common/StructuredStorage/Common/InternalBitConverter.cs
@@ -1,5 +1,6 @@
 using System;
 using System.Collections.Generic;
+using System.Linq;
 using System.Text;
 
 namespace b2xtranslator.StructuredStorage.Common
@@ -59,9 +60,9 @@ internal string ToString(byte[] value)
 
             var enc = new UnicodeEncoding();            
             string result = enc.GetString(value);
-            if (result.Contains("\0"))
+            if (result.Contains('\0'))
             {
-                result = result.Remove(result.IndexOf("\0"));
+                result = result.Remove(result.IndexOf('\0'));
             }
             return result;
         }