Remove vbCrLf from end of string...

lidds

Well-known member
Joined
Oct 19, 2004
Messages
122
Programming Experience
Beginner
I have a multi line text field that has some text in it and I want to remove any vbCrLf items from the end of that text e.g.

[Simon Nicholas]
Hello world
vbCrLf
[Tim Jones]
Hello again
vbCrLf
vbCrLf

What I want to do is just remove any vbCrLf items from the end of the text, but NOT the vbCrLf item in the middle of the text string.

Does anyone know how to do this in VB.Net?

Thanks in advance

Simon
 
VB.NET:
yourstring = yourstring.TrimEnd(vbNewLine.ToArray)
 
Back
Top