Jump to content
Sign in to follow this  
Marius

strings question...

Recommended Posts

Marius

Hey! B)

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 by Marius

Marius back in da hood! :)

Share this post


Link to post
Share on other sites
GaryFrost

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.

 

Share this post


Link to post
Share on other sites
Marius

hey, good idea! B) Thanks


Marius back in da hood! :)

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×