/// <summary>
/// 通过字符数组,处理结尾特殊符号问题,如空格,Tab,回车符号等
/// </summary>
/// <param name="BaseStr"></param>
/// <param name="BStr"></param>
/// <param name="EChar"></param>
/// <returns></returns>
public string StrCut(string BaseStr,string BStr,params char[] EChar)
{
string BaseStr2;
int i,j,minj,Max;
string ps;
ps="";
//minj:表示取最小,最近的那个分隔符的位置
Max=9999999;
minj=Max;
i=StrFind(BaseStr,BStr);
if (i>=0) //找到第一个字符串,
{
BaseStr2=BaseStr.Substring(i+BStr.Length );
foreach (char c in EChar) //处理分隔符
{
j=StrFind(BaseStr2,c);
if (j>=0)
if (minj>j)
minj=j;
}
if (minj<Max)
ps=BaseStr.Substring(i,minj+BStr.Length );
}
return ps;
}
/// 通过字符数组,处理结尾特殊符号问题,如空格,Tab,回车符号等
/// </summary>
/// <param name="BaseStr"></param>
/// <param name="BStr"></param>
/// <param name="EChar"></param>
/// <returns></returns>
public string StrCut(string BaseStr,string BStr,params char[] EChar)
{
string BaseStr2;
int i,j,minj,Max;
string ps;
ps="";
//minj:表示取最小,最近的那个分隔符的位置
Max=9999999;
minj=Max;
i=StrFind(BaseStr,BStr);
if (i>=0) //找到第一个字符串,
{
BaseStr2=BaseStr.Substring(i+BStr.Length );
foreach (char c in EChar) //处理分隔符
{
j=StrFind(BaseStr2,c);
if (j>=0)
if (minj>j)
minj=j;
}
if (minj<Max)
ps=BaseStr.Substring(i,minj+BStr.Length );
}
return ps;
}