asp 截取字符串函数

来源:百度知道 编辑:UC知道 时间:2024/05/17 15:24:20
像这段字符串:abcde<!--"xxxxx"-->fgghjj

我想去取中间的<!--"xxxxx"-->字符串,怎么办叱?

replace("abcde<!--""xxxxx""-->fgghjj","<!--""xxxxx""-->","")

instr(abcde<!--"xxxxx"-->fgghjj,<!--"xxxxx"-->)>0

asp不太懂,给你个.NET的应该差不多!
假设字符串变量为a,前后字符数都不固定的情况下:
=substring(a.indexof("<"),a.lastindexof(">"))

a = "abcde<!--""xxxxx""-->fgghjj "
b = mid(a,instr(a,"<")-1,instr(a,">")-instr(a,"<"))

如同楼上的作mid函数