Solved

string

Posted on 1998-07-04
5
121 Views
Last Modified: 2010-05-03
If I have stringA and stringB, I want to search
stringA To see if it contains  stringB and if so remove
stringB and all Characters to the right within  stringA.
Joe
0
Comment
Question by:josmic
[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
  • 3
  • 2
5 Comments
 
LVL 9

Accepted Solution

by:
cymbolic earned 50 total points
ID: 1464934
dim i as integer

'assuming you have stringA and stringB already defined:

i=instr(stringA,stringB)
if i> 0 then stringA=left$stringA,i-1)

'thats all!
0
 
LVL 9

Expert Comment

by:cymbolic
ID: 1464935
that's left$(stringA,i-1)  minor typo!
0
 
LVL 9

Expert Comment

by:cymbolic
ID: 1464936
that's left$(stringA,i-1)  minor typo!
0
 

Author Comment

by:josmic
ID: 1464937
thank you
why do I see left and sometimes left$, whats the diff.
0
 

Author Comment

by:josmic
ID: 1464938
guess your gone, thanks
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

691 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