|
-
Jan 11th, 2004, 01:23 PM
#1
Thread Starter
Hyperactive Member
Get value of line
Hey,
I have a string, and I want to get the value of the first and second lines to 2 strings.
Thanks!
-
Jan 11th, 2004, 04:38 PM
#2
Lively Member
Can you be more specific I dont understand what ur saying...
It is like wiping your ass with silk, I love it!
-
Jan 11th, 2004, 06:56 PM
#3
Thread Starter
Hyperactive Member
like i have a string with 2 lines
i want to get the value of the first and second line into to different strings
-
Jan 11th, 2004, 07:21 PM
#4
Addicted Member
First get the index of the line break. (vbCrLf)
VB Code:
Dim intIndex As Integer = myString.IndexOf(vbCrLf)
Then get the substrings
VB Code:
Dim line1 As String = myString.Substring(0, intIndex)
Dim line2 As String = myString.SubString(intIndex + 1, (myString.Length - 1) - intIndex)
This code is untested so the index's, lengths may be a little off, but basically it's just a case of using a combination of index and substring methods.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|