Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 186
  • Last Modified:

Find a character in a string

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
gcw
Asked:
gcw
1 Solution
 
DalinCommented:
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
 
gcwAuthor Commented:
See I told ya it would be an easy 50 points.. thanks!
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now