public static ReadStringArray ( this reader, int approximateSize = 10 ) : string[] | ||
reader | this | |
approximateSize | int | |
return | string[] |
public static string[] ReadStringArray(this JsonTextReader reader, int approximateSize = 10) {
if (reader.TokenType != JsonToken.StartArray) {
throw new Exception("StartArray expected");
}
var result = new List<string>(approximateSize);
while (reader.Until(JsonToken.EndArray)) {
if (reader.Value == null) throw new Exception("Value expected");
result.Add(reader.Value.ToString());
}
return result.ToArray();
}