/// <summary> /// 读Txt转化成string /// </summary> /// <param name="txt"></param> /// <param name="isRemoveLine"></param> /// <returns></returns> public static string ReadTxt(TextAsset txt, U_String.En_RemoveLine removeMode = U_String.En_RemoveLine.去掉空行) { string allStr; allStr = txt.text; allStr = U_String.StrRemoveLine(allStr, removeMode); return(allStr); }
/// <summary> /// Txt转化成字符串,要求按标志符分好的 /// </summary> /// <param name="txt">textAsset</param> /// <param name="typeCount">几个分一组</param> /// <param name="splitStr">分隔符</param> /// <param name="isRemoveLine"></param> /// <returns></returns> public static List <List <string> > TxtToStrListList(TextAsset txt, int typeCount, En_ListSplitType splitType = En_ListSplitType.根据类别分, string splitStr = U_String.TextSplitString, U_String.En_RemoveLine removeLineMode = U_String.En_RemoveLine.去掉空行, U_String.En_Trim enTrim = U_String.En_Trim.去掉前后空格) { List <List <string> > strListList = new List <List <string> >(); string allStr = ReadTxt(txt, removeLineMode); string[] strS = U_String.SplitString(allStr, splitStr, enTrim); if (splitType == En_ListSplitType.根据类别分) { strListList = StrSTo_Type_List(typeCount, strS); } else if (splitType == En_ListSplitType.根究组别分) { strListList = StrSTo_Group_List(typeCount, strS); } return(strListList); }