Skip to content

Commit

Permalink
Update InternalBitConverter.cs
Browse files Browse the repository at this point in the history
fixed  text.IndexOf("\0") return 0 in .net core
  • Loading branch information
MadCode1982 committed Sep 3, 2024
1 parent 90d05a6 commit afc8832
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Common/StructuredStorage/Common/InternalBitConverter.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace b2xtranslator.StructuredStorage.Common
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit afc8832

Please sign in to comment.