• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 128
  • Last Modified:

string

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
josmic
Asked:
josmic
  • 3
  • 2
1 Solution
 
cymbolicCommented:
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
 
cymbolicCommented:
that's left$(stringA,i-1)  minor typo!
0
 
cymbolicCommented:
that's left$(stringA,i-1)  minor typo!
0
 
josmicAuthor Commented:
thank you
why do I see left and sometimes left$, whats the diff.
0
 
josmicAuthor Commented:
guess your gone, thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

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