static public
int StringLength(string str)
{
byte[] strbytes;
int tmpcnt = 0;
for ( int i = 0 ; i < str.Length ; i++)
{
strbytes = Encoding.UTF8.GetBytes(str.Substring(i,1));
if (strbytes.Length == 3)
{
tmpcnt += 2;
}
else
{
tmpcnt += 1;
}
}
return tmpcnt;
}
{
byte[] strbytes;
int tmpcnt = 0;
for ( int i = 0 ; i < str.Length ; i++)
{
strbytes = Encoding.UTF8.GetBytes(str.Substring(i,1));
if (strbytes.Length == 3)
{
tmpcnt += 2;
}
else
{
tmpcnt += 1;
}
}
return tmpcnt;
}