Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How do you Delete Vbcrlf from a string?

Posted on 1998-12-04
2
Medium Priority
?
336 Views
Last Modified: 2008-03-10

How do you Delete all VbCrLf from a string?
0
Comment
Question by:vbvpg
2 Comments
 
LVL 3

Accepted Solution

by:
traygreen earned 40 total points
ID: 1448260
You can look for it using instr and then mid it out.
vbcrlf is a two character string comprised of ASCII chars 10 & 13

   Dim iCRLFPos As Integer
   
   iCRLFPos = InStr(1, Text1.Text, vbCrLf)
   If iCRLFPos > 0 Then
      If iCRLFPos = 1 Then
         Text1.Text = Mid(Text1.Text, 2)
      Else
         Text1.Text = Mid(Text1.Text, 1, iCRLFPos - 1) & Mid(Text1.Text, iCRLFPos + 2)
      End If
   End If

0
 
LVL 1

Expert Comment

by:muffinthedog
ID: 1448261
?
While InStr(str, vbCrLf)
    str = Left(str, InStr(str, vbCrLf) - 1) & Right(str, Len(str) - InStr(str, vbCrLf) - 1)
Wend

0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses

877 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question