俺写的一个简单的字符串处理函数(可能会有用)
来源:互联网 发布:pc3000数据恢复论坛 编辑:程序博客网 时间:2024/05/23 21:38
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 728x15, 创建于 08-4-23MSDN */google_ad_slot = "3624277373";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
namespace Joycode.MSN.CommandParsers
{
/// <summary>
/// 用户编码解释器
/// </summary>
internal class Encoders
{
private static System.Text.Encoding enc=System.Text.Encoding.UTF8;
public Encoders()
{
}
public static int Length(string source)
{
return enc.GetByteCount(source);
}
public static int IndexOf(string source,string find, int start)
{
int result=-1;
if(start<source.Length)
{
int index=source.IndexOf(find,start);
if(index>=0)
{
result=enc.GetByteCount(source.Substring(0,index));
}
}
return result;
}
public static int IndexOf(string source, string find)
{
// System.Text.Encoding enc=System.Text.Encoding.UTF8;
// int result=enc.GetByteCount(source.Substring(0,source.IndexOf(find)));
return Encoders.IndexOf(source,find,0);
}
public static string Substring(string source,int start,int count)
{
//int c=enc.GetByteCount(source);
string result="";
try
{
result=enc.GetString(enc.GetBytes(source),start,count);
}
catch
{
}
return result;
}
}
}
俺写的一个简单的字符串处理函数(可能会有用)';return true">
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 728x15, 创建于 08-4-23MSDN */google_ad_slot = "3624277373";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 160x600, 创建于 08-4-23MSDN */google_ad_slot = "4367022601";google_ad_width = 160;google_ad_height = 600;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
using System;namespace Joycode.MSN.CommandParsers
{
/// <summary>
/// 用户编码解释器
/// </summary>
internal class Encoders
{
private static System.Text.Encoding enc=System.Text.Encoding.UTF8;
public Encoders()
{
}
public static int Length(string source)
{
return enc.GetByteCount(source);
}
public static int IndexOf(string source,string find, int start)
{
int result=-1;
if(start<source.Length)
{
int index=source.IndexOf(find,start);
if(index>=0)
{
result=enc.GetByteCount(source.Substring(0,index));
}
}
return result;
}
public static int IndexOf(string source, string find)
{
// System.Text.Encoding enc=System.Text.Encoding.UTF8;
// int result=enc.GetByteCount(source.Substring(0,source.IndexOf(find)));
return Encoders.IndexOf(source,find,0);
}
public static string Substring(string source,int start,int count)
{
//int c=enc.GetByteCount(source);
string result="";
try
{
result=enc.GetString(enc.GetBytes(source),start,count);
}
catch
{
}
return result;
}
}
}
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 728x15, 创建于 08-4-23MSDN */google_ad_slot = "3624277373";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 160x600, 创建于 08-4-23MSDN */google_ad_slot = "4367022601";google_ad_width = 160;google_ad_height = 600;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
- 俺写的一个简单的字符串处理函数(可能会有用)
- 有用的函数-字符串处理
- 几个非常有用的字符串处理函数!
- 一个很有用的字符串分割函数
- 一个蛮有用的字符串解析函数
- 写的一个简单的分割字符串的函数(附原码)
- 写的一个简单的分割字符串的函数(附原码)
- 一些可能会有用的文章
- GetStr: 一个自创蛮有用的字符串函数~
- 写一个函数,实现字符串的复制
- 图形处理中一个比较有用的函数
- 有用的函数-xml处理
- 写一个简单的递归函数
- 写一个简单的反转函数,可以判断abc,bvb等字符串是不是对称的
- (转)actionscript2.0 有用的字符串处理函数(as3.0用不上)
- 字符串处理的一个简单题
- 字符串处理的几个简单函数
- 一些简单的有关字符串处理函数
- 在.NET客户端程序中应用多线程
- 如何将Option Strict的设置保持为On(Add-In技术)
- VB.NET中的简单Web Service例程
- 在C#中调用VB.NET函数实例
- C#中使用Spread6.0全攻略
- 俺写的一个简单的字符串处理函数(可能会有用)
- 关于ADO.NET的一点补充----不知道是不是你想要的
- 使用 Visual Basic .NET 访问 Google 的 Web 服务
- .net平台的5个相关部分
- 使用Mobile控件
- 非官方观点:Java VS. .NET(转Java技术)
- 用ASP.NET开发Web服务的五则技巧
- 公司软件部VB组代码撰写暂行约定 probezy(转贴)
- 第二部分,BETA2操作ACCESS数据库