I used a get text and I have a string that contains 20+ lines.
Lets say I wants to get line 5 from this string.
What kind of sequence would I have?
I used a get text and I have a string that contains 20+ lines.
Lets say I wants to get line 5 from this string.
What kind of sequence would I have?
It can either be split by “.” or By new line .
@dvn If the Splitting of String doesn’t work by the regular method, you can use this :
strArray = System.Text.RegularExpressions.Regex.Split(str,“\n”).Take(5).ToArray
please provide sample input and expected output. @dvn
Thanks!
Lets say the input came out as 6 lines like this:
Alice : 1234
Jason : 2413
Mark : 2257
Cassy :1111
Brad : 1090
Greg : 7575
I only want the 4th line in this case so my output would be:
Cassy :1111
@dvn If you just want the 4th line, then try this :
str = System.Text.RegularExpressions.Regex.Split(str,“\n”)(3)
I tried you example it is working great.
But I also have same condition with some different specification. Can you please help me in this.
like- I also have above condition
Lets say the input came out as 6 lines like this:
Alice : 1234
Jason : 2413
Mark : 2257
Cassy :1111
Brad : 1090
Greg : 7575
I only want the 4th line in this case so my output would be:
I have to first search Cassy … that it is appearing or not then if it appearing
then I only want 1111 of cassy in a variable…
please show me a way with Regex how I can manage all things
Thanks for help- Inn advance
Main Specifications-
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.