Find, del char from string?

E

Ed

str1="abcdefg"
str2="cd"
If str2 is found in str1, then delete the characters of str2 from str1.
What do I need to do this?

Ed
 
T

Tony Jollans

The difference between the two is how many occurrences of str2 are removed
 
J

Jay Freedman

OK, but be careful... Tony's right. The Replace function will remove
all occurrences of str2 from str1 if there are multiples, while the
Split/Join method removes only the first one.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top