mirror of
https://github.com/thebreaddev/Supercell.GUT.git
synced 2024-11-14 01:14:37 +00:00
8c6a533918
todo: improve code and finish base structures
30 lines
594 B
C#
30 lines
594 B
C#
using System.Text;
|
|
|
|
namespace Supercell.GUT.Titan.Logic.Util;
|
|
|
|
public static class LogicStringUtil
|
|
{
|
|
public static string SafeString(string a1, string? a2, string a3)
|
|
{
|
|
if (a2 != null)
|
|
{
|
|
a1 = a2;
|
|
}
|
|
else
|
|
{
|
|
a1 = a3;
|
|
}
|
|
|
|
return a1;
|
|
}
|
|
|
|
public static string CreateString(byte[] byteArray, int offset, int length)
|
|
{
|
|
return Encoding.UTF8.GetString(byteArray, offset, length);
|
|
}
|
|
|
|
public static byte[] GetBytes(string value)
|
|
{
|
|
return Encoding.UTF8.GetBytes(value);
|
|
}
|
|
}
|