Marius Posted November 12, 2005 Share Posted November 12, 2005 (edited) Hey! I have a question here: How do I replace in string 5 lines of text, if I know only the first line, and want to replace next 4 lines after it? I have a string wich contains @CRLFs: (sometext & @CRLF & line1 & @CRLF & line2 & @CRLF & line3 & @CRLF & line4 & @CRLF & line5 & @CRLF & someothertext) Ok,now the funniest part: let's say I know only the line1 of string. And I need to replace in string this line and 4 more lines after it: (sometext & @CRLF & newline1 & @CRLF & newline2 & @CRLF & newline3 & @CRLF & newline4 & @CRLF & newline5 & @CRLF & someothertext) Edited November 12, 2005 by Marius Marius back in da hood! :) Link to comment Share on other sites More sharing options...
GaryFrost Posted November 12, 2005 Share Posted November 12, 2005 put it into an array then you can do what you need to do pretty easy $a_lines = StringSplit("sometext & @CRLF & line1 & @CRLF & line2 & @CRLF & line3 & @CRLF & line4 & @CRLF & line5 & @CRLF & someothertext",@CRLF,1) for $x = 1 to $a_lines[0] ; do what you need to do. next SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
Marius Posted November 12, 2005 Author Share Posted November 12, 2005 hey, good idea! Thanks Marius back in da hood! :) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now