Sign in to follow this  
Followers 0
darkmaster071

How to get a certain line from a string

4 posts in this topic

So i have a big string and i need to search for a certain sentence in it. Then i need to get the line number in which this sentence was found and copy that entire line into another variable.

I see that StringInStr gives me the position/number of chars where that substring is located. But i need a line number and a way to get that entire line. Is there a way to do this? Thanks, help greatly appreciated.

Share this post


Link to post
Share on other sites



So i have a big string and i need to search for a certain sentence in it. Then i need to get the line number in which this sentence was found and copy that entire line into another variable.

I see that StringInStr gives me the position/number of chars where that substring is located. But i need a line number and a way to get that entire line. Is there a way to do this? Thanks, help greatly appreciated.

if you're reading in from a file, you could just use _FileReadToArray() and then check each element for the text and the index would be your line number

1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
Share on other sites

Just what i need :blink: Thanks

Share this post


Link to post
Share on other sites

Just what i need :blink: Thanks

np, glad to help

1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

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  
Followers 0