• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 124
  • 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

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

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