0

Hi all,

I am stuck on what 'should' be a fairly simple thing to solve, however after a good search i haven't got very far.

Basically i am pulling data from a database which might have multiple lines of data, however for one particular task i only want to grab the first line of text (as a sort of preview).

I.e:
This is a sample sentence with
multiple
lines

I would only want to get the bit saying "This is a sample sentence with". How could i go about doing this? I have tried the 'trim' function but that didn't quite do what i was hoping for.

Thanks in advance for any input! :S

2
Contributors
2
Replies
4
Views
7 Years
Discussion Span
Last Post by a_salted_peanut
1

you could place that into a String variable, then use myVar.Split(vbCrLf) . That would create a String() array, and "This is a sample sentence" would be element 0 of the array.

Votes + Comments
Brilliant and easy method!
1

Thanks Alc! I don't know why i didn't think of that method... It's now working! :D

Edited by a_salted_peanut: n/a

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.