///str_value 字符
///str_len 要截取的字符長度
public string leftx(string str_value
{
int p_num =
int i;
string New_Str_value =
if (str_value==
{
New_Str_value =
}
else
{
int Len_Num = str_value
//if (Len_Num < str_len)
//{
// str_len = Len_Num;
//}
for (i =
{
//str_value
if (i >Len_Num) break;
char c = Convert
if (((int)c >
{
p_num = p_num +
}
else
{
p_num = p_num +
}
if (p_num >= str_len)
{
New_Str_value = str_value
break;
}
else
{
New_Str_value = str_value;
}
}
}
return New_Str_value;
}
From:http://tw.wingwit.com/Article/program/net/201311/11409.html