
CODE: [Copy to clipboard]应该得到1[a]2 [1]
[b]1 [']
2[c]
CODE: [Copy to clipboard]请大家帮帮看,有什么好算法?想了半天头都大了12
1
2
CODE: [Copy to clipboard]谢 slore 兄set ws = createobject("wscript.shell")
set fso = createobject("scripting.filesystemobject")
set file = fso.opentextfile("test.txt",1)
str = file.readall '读文本
num = len(str) '文本字符数
for i = 1 to num
str1 = instr(str,"[") '返回 "[" 出现的位置
str2 =instr(str,"]") '返回 "]" 出现的位置
str2 = str2-str1+1
num1 = str2 - str1 +2
delstr=mid(str,str1,str2) '提取 "[...]" 字符串
flag = string(num1,"*") '将这个字符串替换成指定长度的 "*" 号。
next
str = replace(str,"*","") '然后替换掉
msgbox str
| 欢迎光临 中国DOS联盟论坛 (http://cndos.fam.cx/forum/) | Powered by Discuz! 2.5 |