Solved

Find a character in a string

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
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 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…

930 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

9 Experts available now in Live!

Get 1:1 Help Now