$it="abc" & @CRLF & "bcd" & @CRLF & "rty" & @CRLF & "iop" & @CRLF 上面的字符串弄成下面的格式,请问有可能吗? [code] $it = "<a href=http://www.baidu.com/s?wd=abc>abc</a>" & @CRLF & "<a href=http://www.baidu.com/s?wd=bcd>bcd</a>" & @CRLF & "<a href=http://www.baidu.com/s?wd=rty>rty</a>" & @CRLF & "<a href=http://www.baidu.com/s?wd=iop>iop</a>" & @CRLF &
举报
Local $it = "abc" & @CRLF & "bcd" & @CRLF & "rty" & @CRLF & "iop" & @CRLF Local $sS = StringSplit($it, @CRLF, 1) Local $str = StringFormat("<a href=http://www.baidu.com/s?wd=%s>%s</a>\r\n<a href=http://www.baidu.com/s?wd=%s>%s</a>\r\n<a href=http://www.baidu.com/s?wd=%s>%s</a>\r\n<a href=http://www.baidu.com/s?wd=%s>%s</a>\r\n", _ $sS[1], $sS[1], $sS[2], $sS[2], $sS[3], $sS[3], $sS[4], $sS[4]) MsgBox(0, '', $str)
Local $Str = _ 'abc' & @CRLF & _ 'bcd' & @CRLF & _ 'rty' & @CRLF & _ 'lop' & @CRLF MsgBox(0, '原字符串', $Str) $s1 = "<a href=http://www.baidu.com/s?wd=" $s10 = ">" $s11 = "</a>" Local $Test = StringRegExpReplace($str, '\V+', $s1 & '$0' & $s10 & '$0' & $s11) MsgBox(0, '替换结果', $Test)
您需要 登录 才可以下载或查看,没有账号?加入
afan的技术还是值得信任的,和pcbar,三恨一样强了。 jjf 发表于 2011-9-21 19:32
本版积分规则 发表回复 回帖后跳转到最后一页
|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度
GMT+8, 2026-7-5 12:49 , Processed in 0.100214 second(s), 25 queries .
Powered by Discuz! X3.5 Licensed
© 2001-2026 Discuz! Team.