下载此文档

String处理.doc


文档分类:外语学习 | 页数:约16页 举报非法文档有奖
1/16
下载提示
  • 1.该资料是网友上传的,本站提供全文预览,预览什么样,下载就什么样。
  • 2.下载该文档所得收入归上传者、原创者。
  • 3.下载的文档,不会出现我们的网址水印。
1/16 下载此文档
文档列表 文档介绍
String 处理 Code highlighting produced by Actipro CodeHighlighter (freeware)/-->using System; using ; using ; using ; using ; using ; using ; using ; using ; using ; using ; namespace { /// <summary> /// 字符串数据数据处理扩展类/// </summary> /// <remarks> 字符串数据数据处理扩展类</remarks> public static class StringHelper { #region 字符串格式转换///<summary> /// 把一个字符串截取成数据返回///</summary> ///<param name="s"> 目标字符串</param> ///<param name="sep"> 分割标示符</param> ///<returns> 返回一个分割出来的数组</returns> public static string[] ToArray(this string s, string sep) { int sepLen = ; ArrayList arr = new ArrayList(); string item; int pos; if (sep != "") { while (true) { pos = (sep); if (pos > 0) { item = (0, pos); (item); if (sepLen + pos >= ) break; s= (sepLen + pos, - sepLen - pos); } else if (pos == 0) { if (sepLen >= ) break; s= (sepLen, - sepLen); } else { if ( > 0) (s); break; } }} else { char[] arr_str = (); for (int i= 0;i< (0); i++) { (arr_str[i].ToString()); }} string[] result = new string[]; (result); return result; } /// <summary> /// 将字符串转化成 Byte[] /// </summary> public static Byte[] ToByteArray(this string s) { return (( (s))); } /// <summary> /// 将 Byte[] 转化成字符串/// </summary> public static string ToByteString(this byte[] s) { return (s); } /// <summary> /// 将字符串转化成 XML /// </summary> public static XmlDocument ToXml(this string s) { XmlDocument xmldoc = new XmlDocument(); (new (("GB 2312").GetBytes(s))); return xmldoc; } ///<summary> /// 把一个字符串截取成数据返回///</summary> ///<param name="s"> 目标字符串</param> ///<param na

String处理 来自淘豆网m.daumloan.com转载请标明出处.

相关文档 更多>>
非法内容举报中心
文档信息
  • 页数16
  • 收藏数0 收藏
  • 顶次数0
  • 上传人xxj16588
  • 文件大小0 KB
  • 时间2016-03-20
最近更新