public static T[] ParseCollection <T>(string s, Func <string, int, T> itemParser, string itemPattern = null) { var collFormatting = CurrentArrayFormatting; var coll = PwrArray.Parse <T>(s, itemParser, itemPattern, new[] { collFormatting.DelimiterChar }, collFormatting.SpaceChars.ToArray(), new[] { collFormatting.EscapeChar }); if (coll == null) { throw new FormatException(); } return(coll); }
public static T[] ParseArray <T>(string s, Func <string, int, T> itemParser, string itemPattern = null) { var arrayFormatting = CurrentArrayFormatting; var array = PwrArray.Parse <T>(s, itemParser, itemPattern, new[] { arrayFormatting.DelimiterChar }, arrayFormatting.SpaceChars.ToArray(), new[] { arrayFormatting.EscapeChar }, new[] { arrayFormatting.OpenBracketChar }, new[] { arrayFormatting.CloseBracketChar }); if (array == null) { throw new FormatException(); } return(array); }