24 lines
441 B
C#
24 lines
441 B
C#
using System.Text.Json;
|
|
|
|
namespace Sasalka;
|
|
|
|
public static class SimpleJson
|
|
{
|
|
public static string[] ParseClothingTitles( string json )
|
|
{
|
|
using var doc = JsonDocument.Parse( json );
|
|
var root = doc.RootElement;
|
|
var list = new List<string>();
|
|
|
|
foreach ( var elem in root.EnumerateArray() )
|
|
{
|
|
if ( elem.TryGetProperty( "Title", out var title ) )
|
|
{
|
|
list.Add( title.GetString() );
|
|
}
|
|
}
|
|
|
|
return list.ToArray();
|
|
}
|
|
}
|