您的位置:首页 > Web前端 > HTML

void FormatHtml(CString &str)

2005-04-05 08:12 323 查看
void FormatHtml(CString &str)
{
CString tmp(str);
int index = -1;
int i=0;
while (index < str.GetLength())
{
index ++;
index = str.Find(">", index);
if (index == -1)
break;
if (str.GetAt(index + 1) == '<')
continue;
tmp.Insert(index+1 + i*2, "/r/n");
i++;
}
str = tmp;
index = -1;
i=0;
while (index < str.GetLength())
{
index ++;
index = str.Find("<", index);
if (index == -1)
break;
tmp.Insert(index + i*2, "/r/n");
i++;
}
str = tmp;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐