; start += 1;
single ++ ;
}
if (start >= aLength)
{
if ( end % 2 == 0)
{
if ( single % 2 == 0 )
{
end = i+1 ;
}
else
{
end = i ;
}
}
else
{
end = i+1 ;
}
break ;
}
}
string temp = aOrgStr.Substring(0, end);
string temp2 = aOrgStr.Remove(0,end);
aAfterStr = temp2 ;
return temp ;
}
single ++ ;
}
if (start >= aLength)
{
if ( end % 2 == 0)
{
if ( single % 2 == 0 )
{
end = i+1 ;
}
else
{
end = i ;
}
}
else
{
end = i+1 ;
}
break ;
}
}
string temp = aOrgStr.Substring(0, end);
string temp2 = aOrgStr.Remove(0,end);
aAfterStr = temp2 ;
return temp ;
}
运行结果 :
str = MutiSubString("abc汉字字符", 5 , aAfterStr)
str = "abc汉"
aAfterStr ="字字符"
已了却一直以来使用 str.Length 把汉字当一个字符来用的毛病
| 对此文章发表了评论 |

