Solved

string

Posted on 1998-07-04
5
116 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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
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…
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…

747 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