当前位置: 技术问答>java相关
在ASP 有SPLIT ;JSP里怎样写
来源: 互联网 发布时间:2015-02-23
本文导语: 在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") a...
在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),"
")
拜托
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),"
")
拜托
|
you need to use StringTokenizer:
StringTokenizer strTok = new StringTokenizer("1;2;3;4", ";");
while (strTok.hasMoreTokens())
{
System.out.println(strTok.nextToken());
}
StringTokenizer strTok = new StringTokenizer("1;2;3;4", ";");
while (strTok.hasMoreTokens())
{
System.out.println(strTok.nextToken());
}