获得空行个数
2016-02-09 10:38:46 访问(1366) 赞(0) 踩(0)
/// <summary>
/// 获得空行个数
/// </summary>
/// <param name="str">
/// <returns></returns>
public int GetBlank(string str)
{
if (str == null || str.Length == 0)
return 0;
int iLen = str.Length;
int theResult = 0;
for (int i = 0; i < iLen; ++i)
{
if (str[i] == ' ')
{
++theResult;
continue;
}
if (str[i] == '\t')
{
++theResult;
continue;
}
if (str[i] == '\n')
{
++theResult;
continue;
}
if (str[i] == '\r')
{
++theResult;
continue;
}
}
return theResult;
}
标签:
获得空行个数 


上一条:
下一条:
相关评论
发表评论