将一段文字,当遇到规定标志时自动换行
打开txt文件,然后一段:
http://community.csdn.net/IndexPage/NewTopic.aspx?key=%E8%BE%93%E5%85%A5%E9%97%9Fhttp://community.csdn.net/IndexPage/NewTopic.aspx?key=%E8%BE%93%E5%85%A5%E99Fhttp://community.csdn.net/IndexPage/NewTopic.aspx?key=%E8%BE%93%E5%85%A5%E9Fhttp://community.csdn.net/IndexPage/NewTopic.aspx?key=%E8%BE%93%E5%85%A5%E9%97%AE%E9%A2%98%EF%BC%
没有分行,如何读取这段代码,然后每当有 "http:// "的时候就自动回车,变成这个样子,然后close
http://community.csdn.net/IndexPage/NewTopic.aspx?key=%E8%BE%93%E5%85%A5%E9%97%9F
http://community.csdn.net/IndexPage/NewTopic.aspx?key=%E8%BE%93%E5%85%A5%E99F
http://community.csdn.net/IndexPage/NewTopic.aspx?key=%E8%BE%93%E5%85%A5%E9F
http://community.csdn.net/IndexPage/NewTopic.aspx?key=%E8%BE%93%E5%85%A5%E9%97%AE%E9%A2%98%EF%BC%
感谢
[解决办法]
replace(str, "http:// ",chr(13) & "http:// ")
[解决办法]
tempstr = Replace(tempstr, "http:// ", vbcrlf & "http:// ")
[解决办法]
Dim FileNum As Integer, tempstr As String
tempstr = RichTextBox1.Text
tempstr = Replace(tempstr, "http:// ", Chr(13) & "http:// ")
FileNum = FreeFile
Open App.Path & "Test1.Text " For Output As FileNum
Print #FileNum, tempstr
Close #FileNum
这样写可以的啊
[解决办法]
try:
1.tempstr = Replace(tempstr, "http:// ", chr(10) & chr(13) & "http:// ")
2.tempstr = Replace(tempstr, "http:// ", chr(13) & chr(13) & "http:// ")
3.tempstr = Replace(tempstr, "http:// ", vbcrlf & "http:// ")
4.tempstr = Replace(tempstr, "http:// ", vbcrlf & vbcrlf & "http:// ")
[解决办法]
你要在txt中换行
那么可以用fso.writeline来,每行写入
你如何写入到txt中的呢?你分行写入就好
[解决办法]
try:
Dim FileNum As Integer, tempstr As String
tempstr = RichTextBox1.Text
tempstr = Replace(tempstr, "http:// ", vbcrlf & "http:// ")
FileNum = FreeFile
Open App.Path & "Test1.Text " For Binary As FileNum
Put #FileNum,, tempstr
Close #FileNum