Solved

Find a character in a string

Posted on 1999-01-05
2
184 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
[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 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

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

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…
Suggested Courses
Course of the Month3 days, 17 hours left to enroll

630 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