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;
}
{
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;
}
相关文章推荐
- error C2664: 'void ATL::CStringT<BaseType,StringTraits>::Format (...)
- error C2664: “void ATL::CStringT<BaseType,StringTraits>::Format(const wchar_t *,...)”: 不能将
- html 空链接 href="#"与href="javascript:void(0)"的区别
- 学无止境--> CString Format 格式化动态字符串宽度
- 【mysql】Date和String的互相转换(DATE_FORMAT & STR_TO_DATE)
- 【mysql】Date和String的互相转换(DATE_FORMAT & STR_TO_DATE)
- 【mysql】Date和String的互相转换(DATE_FORMAT & STR_TO_DATE)
- 【mysql】Date和String的互相转换(DATE_FORMAT & STR_TO_DATE)
- 【mysql】Date和String的互相转换(DATE_FORMAT & STR_TO_DATE)
- MFC2010自带的一个字符集转换函数UTF8ToString(LPCSTR lpSrc, CString& strDst, int nLength)
- 【mysql】Date和String的互相转换(DATE_FORMAT & STR_TO_DATE)
- 通过 DataFormatString="{0:yyyy/MM/dd}" HtmlEncode="false" 格式化显示时间
- CString 不能使用_T("%hs")这种Format
- 【mysql】Date和String的互相转换(DATE_FORMAT & STR_TO_DATE)
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-str
- Html a href="#" 与 a href="javascript:void(0)" 的区别
- ie6下href="javascript:void(0)" 与 document.location="a.html" 不兼容
- jsp中href="#"与javascript:void(0)的区别
- HTML 字符实体 < >: &等
- HTML <!DOCTYPE> 标签