|
-
August 17th, 2001, 10:33 AM
#1
Removing Carrage Returns
Hi There,
I have a control that has a text box that allows users to enter text. How do I delete/remove the carriage returns if the users did not enter any text and hit the carriage return key on the keyboard a few times.
Thanks in Advance
Beth
-
August 17th, 2001, 10:37 AM
#2
Re: Removing Carrage Returns
Replace function very useful when I want to avoid too many append operations just to insert
non-printable characters.
Replace(Text1,vbCrLf,"")
Iouri Boutchkine
[email protected]
-
August 17th, 2001, 11:32 AM
#3
Re: Removing Carrage Returns
I need to search for lines that only has vbCrLf and remove them, but leaving those lines that containing text.
-
August 17th, 2001, 01:00 PM
#4
Re: Removing Carrage Returns
Check the length of the line. If len(line) = 0 then remove vbcrlf
Iouri Boutchkine
[email protected]
-
August 17th, 2001, 01:14 PM
#5
Re: Removing Carrage Returns
Sorry, I'm very new to VB Programming. Is there a function for remove vbCrLf as you mentioned
Thanks for all your help
-
August 17th, 2001, 01:50 PM
#6
Re: Removing Carrage Returns
Here is my code
If Len(ctlTextBox.Text) = 0 Then
ctlTextBox.Text = ""
Else
ctlTextBox.Text=ctlTextBox.Text & vbCrLf
End if
If I hit the return key a few time on my keyboard in the text box. ctlTextBox.Text gives me "llll"(not exactly as shown, it more vertical barcode marks in bold). It is indicating it is not 0.
Appreciate your help.
Beth
-
August 17th, 2001, 02:12 PM
#7
Re: Removing Carrage Returns
Your code is not going to do anything but add the vbcrlf at the end of the text box.
What you have to do is read the text between the vbcrlf using InStr function. If the length of the line between vbcrlf is = 0 then replace the vbcrlf with "". Otherwise do not do anything
Iouri Boutchkine
[email protected]
-
August 20th, 2001, 09:00 AM
#8
Re: Removing Carrage Returns
Replace function will substitute vbcrlf with "" (or whatever you want to)
Iouri Boutchkine
[email protected]
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
|