By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,019 Members | 1,073 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,019 IT Pros & Developers. It's quick & easy.

string

P: n/a
Fei
Hi,

I have a simple problem. I have a string variable. Somehow it has Enter
in the string. So When I show this string in a textbox, it will
automatically add one Enter at the end.

My question is how to trim off this Enter. If I use Trim() from String
class, It only removes the Empty space.

Dim strTest as string
strTest.Trim(); ----------> This can NOT remove Enter.
Thanks in advance.

Fei
Nov 21 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
newstring = replace(oldstring, chr(10), "")

if chr(10) doesn't work try chr(13)

chr(10) is carriage return and chr(13) is line feed
"Fei" wrote:
Hi,

I have a simple problem. I have a string variable. Somehow it has Enter
in the string. So When I show this string in a textbox, it will
automatically add one Enter at the end.

My question is how to trim off this Enter. If I use Trim() from String
class, It only removes the Empty space.

Dim strTest as string
strTest.Trim(); ----------> This can NOT remove Enter.
Thanks in advance.

Fei

Nov 21 '05 #2

P: n/a
Fei
thanks. chr(13) works for me.

Fei

"sherman" <sh*****@discussions.microsoft.com> wrote in message
news:FE**********************************@microsof t.com...
newstring = replace(oldstring, chr(10), "")

if chr(10) doesn't work try chr(13)

chr(10) is carriage return and chr(13) is line feed
"Fei" wrote:
Hi,

I have a simple problem. I have a string variable. Somehow it has
Enter
in the string. So When I show this string in a textbox, it will
automatically add one Enter at the end.

My question is how to trim off this Enter. If I use Trim() from String
class, It only removes the Empty space.

Dim strTest as string
strTest.Trim(); ----------> This can NOT remove Enter.
Thanks in advance.

Fei

Nov 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.