求-----split的用法。 求-----split的用法。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 string s ="a|b|c|d";string[] des = s.Split(new char []{'|'}); string[] des = "a,b,c,d".Split( ",".ToCharArray() ); --------------------------------------------------------------程序,犹如人生。 dim a()as stringa=split("a,s,d,f,g,h".",")则a(0)为aa(1)为sa(5)为h 使用这个重载有时会出问题,最好使用string s ="a|b|c|d";string[] des = s.Split(new string[]{"|"}); 比如有string ss = "sdfsfd.dsfdf.sdfsaf";那么string[] ssArray = ss.Split('.'); using System;public class StringSplit2 { public static void Main() { string delimStr = " ,.:"; char [] delimiter = delimStr.ToCharArray(); string words = "one two,three:four."; string [] split = null; Console.WriteLine("The delimiters are -{0}-", delimStr); for (int x = 1; x <= 5; x++) { split = words.Split(delimiter, x); Console.WriteLine("\ncount = {0,2} ..............", x); foreach (string s in split) { Console.WriteLine("-{0}-", s); } } }} C#悬浮窗问题 怎样实时保存datagridview中的数据? 求一个linq语句 怎样用接口来定义泛型的类型 什么是无符号字符? 使用DataGrid如何进行降序。 win2000下 aspnet_wp占有内存居高不下,急... datagrid超链接的问题 关于listView 图片选中状态的问题!(60分) javascript问题 编译错误: 将元数据写入文件“****\obj\Debug\****.dll”时发生意外错误 --“未指定的错误 ” .net 安装出现要求重起,但还是不行
string[] des = s.Split(new char []{'|'});
string[] des = "a,b,c,d".Split( ",".ToCharArray() );
--------------------------------------------------------------
程序,犹如人生。
a=split("a,s,d,f,g,h".",")
则a(0)为a
a(1)为s
a(5)为h
string s ="a|b|c|d";
string[] des = s.Split(new string[]{"|"});
那么string[] ssArray = ss.Split('.');
public static void Main() { string delimStr = " ,.:";
char [] delimiter = delimStr.ToCharArray();
string words = "one two,three:four.";
string [] split = null; Console.WriteLine("The delimiters are -{0}-", delimStr);
for (int x = 1; x <= 5; x++) {
split = words.Split(delimiter, x);
Console.WriteLine("\ncount = {0,2} ..............", x);
foreach (string s in split) {
Console.WriteLine("-{0}-", s);
}
}
}
}