Solved

How do you Delete Vbcrlf from a string?

Posted on 1998-12-04
2
324 Views
Last Modified: 2008-03-10

How do you Delete all VbCrLf from a string?
0
Comment
Question by:vbvpg
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 3

Accepted Solution

by:
traygreen earned 20 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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
Course of the Month7 days, 12 hours left to enroll

632 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