Solved

How do you Delete Vbcrlf from a string?

Posted on 1998-12-04
2
276 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 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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

707 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now