Solved

Find a character in a string

Posted on 1999-01-05
2
178 Views
Last Modified: 2012-06-21
I want to isolate and remove all apostrophies "'" from the string "Jerry's House of Pancakes"(as you can tell I am craving food right now).  I know you can do this with an array but every attempt I have made seems to fail. Any code would be helpful. This should be an easy 50 for someone : )
0
Comment
Question by:gcw
2 Comments
 
LVL 9

Accepted Solution

by:
Dalin earned 50 total points
ID: 1454112
Try:

Dim myString as String
Dim thePos as Integer
Dim finalString as String
 
MyString = "Jerry's House.."

thePos = Instr(myString, "'")      ' Returns the position
If thePos > 0 then  'Find '
     FinalString = Left(MyString, thePos -1) & right(myString, Len(myString)-thePos)

If you have multiple, put it in a loop.

Regards
Dalin
0
 

Author Comment

by:gcw
ID: 1454113
See I told ya it would be an easy 50 points.. thanks!
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…

747 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

10 Experts available now in Live!

Get 1:1 Help Now