C# split与join字符串处理
using System;using System.Collections.Generic;using System.Text;namespace split与join字符串处理{ class Program { static void Main(string[] args) { string s = "123--23--34--3434-444------2"; string[] c = s.…
using System;using System.Collections.Generic;using System.Text;namespace split与join字符串处理{ class Program { static void Main(string[] args) { string s = "123--23--34--3434-444------2"; string[] c = s.…
s = "123--23--34--3434-444------2";ss=s.split(-)print(ss)#输出结果 [123, , 23, , 34, , 3434, 444, , , , , , 2]tempList=[]for ts in ss: if(ts!=): tempList.append(ts)print(tempList)#输出结果 [123, 23, 34, 3434, 444, 2]#获取前面两个 以‘-’…