String extraction

S

Stefan Hoffmann

hi John,
How can I extract the first line form a multi-line string?
Use Left(yourString, InStr(yourString, Chr(13) & Chr(10))) to get the
first line.


mfG
--> stefan <--
 
D

Douglas J. Steele

Stefan Hoffmann said:
hi John,

Use Left(yourString, InStr(yourString, Chr(13) & Chr(10))) to get the
first line.

Or Split(yourString, Chr(13) & Chr(10))(0)
 
S

Stefan Hoffmann

hi Stuart,

Stuart said:
MyStringVariable = Left(MultiLine, Instr(MultiLine, vbCrLf) - 1)
As the OP has posted it also in mpa.queries:

The VBA constant vbCrLf is not available in a query and must be replaced
with Chr(13) & Chr(10) in that case.


mfG
--> stefan <--
 
Top