Check and replace certain char
in
Programming Questions
•
1 year ago
Hello,
I have a rather simple question, but can't figure out how to do it.
So I have a couple of String variables. I want to check whether they contain the combination #11#.
If so, I want to replace the #11# by a "and".
So let's say like this:
string1 = "Tony#11#Susan. It contains a #11# and I want to "rewrite" this String as "Tony and Susan".
I know that when using equals() I can check whether a whole string equals a specific word.
But I just want to check if there are certain parts of a string equal to my #11#.
I'm glad for any help!!!
1