/// <summary> /// encodes a list with length prefix /// </summary> /// <param name="items"></param> /// <returns></returns> public static string LengthEncodeList(params string[] items) { var stringable = NaturalStringableList.New(items).DecorateListWithLength(); var rv = stringable.GetValue(); return(rv); }
/// <summary> /// decodes a lengthencoded list /// </summary> /// <param name="text"></param> /// <returns></returns> public static List <string> LengthDecodeList(string text) { var stringable = NaturalStringableList.New().DecorateListWithLength(); stringable.Parse(text); List <string> rv = new List <string>(); rv.AddRange(stringable); return(rv); }
public static bool IsListLengthFormatted(this string text) { var stringable = NaturalStringableList.New().DecorateListWithLength(); return(stringable.IsListLengthFormatted(text)); }
public static bool IsListDelimitedFormatted(this string text, string prefix, string delim, string suffix) { var stringable = NaturalStringableList.New().Delimit(prefix, delim, suffix); return(stringable.IsListDelimitedFormatted(text)); }
public static NaturalStringableList ParseNew(string data) { var rv = new NaturalStringableList(); rv.Parse(data); return rv; }
public static NaturalStringableList MakeStringableList(this string[] list ) { return NaturalStringableList.New(list); }
public static NaturalStringableList MakeStringableList(this List<string> list) { return NaturalStringableList.New(list.ToArray()); }