Solved

string

Posted on 1998-07-04
5
118 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
  • 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: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone 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

Suggested Solutions

Title # Comments Views Activity
VBA/SQL - Connect to SQL server and pull data 4 118
Help me. 3 60
VB6 ListBox Question 4 48
Copy a range from 1..n excel sheets to one destination sheet 2 55
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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 utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

839 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