在ASP 有SPLIT ;JSP里怎样写

hxq2000 2001-11-25 10:44:04
在ASP 有SPLIT ;JSP里怎样写
info_id=trim(Request("info_id"))
set RS=Server.CreateObject("ADODB.Recordset")
RS.Open "select info_title,info_text from t_news where info_id=" & info_id ,Application("Conn")
g_info_Text = RS("info_text")
info_Title= RS("info_Title")
asp_str3=""
asp_str2=split(g_info_text,";")
for each asp_ii in asp_str2
asp_str3=asp_str3+chr(asp_ii)
next
g_info_text=asp_str3
g_info_text=replace(g_info_text," "," ")
g_info_text=replace(g_info_text,chr(13)&chr(10),"<br>")
拜托

...全文
35 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
karma 2001-11-25
  • 打赏
  • 举报
回复
you need to use StringTokenizer:

StringTokenizer strTok = new StringTokenizer("1;2;3;4", ";");
while (strTok.hasMoreTokens())
{
System.out.println(strTok.nextToken());
}

81,092

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧