Click here to Skip to main content
15,886,362 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a text File as

1.asdasasd123123adasdasd^^asdasd^^12345678901234567890
2.asdasasd123123adasdasd^^asdasdweqw^^aasa
--
--
and so on .the String "12345678901234567890" contains 20 characters
which is in first line of the text file
I just want to capture this string that is 12345678901234567890
The length of the First line may vary accordingly but this character
always contain 20 characters.
I just need to capture this 20 character string and to show
in a message box.

Can it be Done.
Assist
Posted

1 solution

Yes:
VB
Using tr As TextReader = New StreamReader("D:\Temp\Data.txt")
    Dim s As String = tr.ReadLine()
    Dim bitYouWant As String = s.Substring(s.Length - 20)
    Console.WriteLine(bitYouWant)
End Using
 
Share this answer
 
Comments
Monjurul Habib 8-May-12 16:27pm    
5!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900