标题:换行问题
取消只看楼主
shuiyuan0929
Rank: 1
等 级:新手上路
帖 子:15
专家分:0
注 册:2006-3-13
 问题点数:0 回复次数:2 
换行问题
我有一段很长的文本内容,需要显示在textarea文本框中,怎么显示出来的都在一行里没有换行,我明明按了回车,怎么搞的啊?请大师们指点以下
搜索更多相关主题的帖子: 文本框 
2006-03-28 14:34
shuiyuan0929
Rank: 1
等 级:新手上路
帖 子:15
专家分:0
注 册:2006-3-13
得分:0 

不行啊显示出来是空格,我在javabean里加了个
public String GetContent(String content)
{
String postCon=content;
int i;
while(postCon.indexOf("<BR>")>0)
{
i=postCon.indexOf("<BR>");
if(i>0) postCon=postCon.substring(0,i)+"\r\n"+postCon.substring(i+4);
}
return postCon;
}
// "\r\n"---><BR>
public String ShowContent(String content)
{
String postCon=content;
int i;
while(postCon.indexOf("\r\n")>0)
{
i=postCon.indexOf("\r\n");
if(i>0) postCon=postCon.substring(0,i)+"<BR>"+postCon.substring(i+2);
}
return postCon;
}
在jsp中怎么调用啊

2006-03-28 16:39
shuiyuan0929
Rank: 1
等 级:新手上路
帖 子:15
专家分:0
注 册:2006-3-13
得分:0 

问题解决了谢谢大家

2006-03-29 11:29



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-53416-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.055236 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved