Files
ZHGD_Web/Assets/UniversalMediaPlayer/Scripts/Sources/Services/Helpers/Json.cs

39 lines
928 B
C#
Raw Normal View History

2025-07-13 23:16:20 +08:00
namespace UMP.Services.Helpers
{
internal static class Json
{
public static string GetKey(string key, string source)
{
var quotedKey = '"' + key + '"';
var index = 0;
while (true)
{
index = source.IndexOf(quotedKey, index);
if (index == -1)
return string.Empty;
index += quotedKey.Length;
var start = index;
start = source.SkipWhitespace(start);
if (source[start++] != ':')
continue;
start = source.SkipWhitespace(start);
if (source[start++] != '"')
continue;
var end = start;
while (source[end] != '"')
end++;
return source.Substring(start, end - start);
}
}
}
}