Answer the question
In order to leave comments, you need to log in
Java String is it possible to go through the entire string sequentially and find a match?
For example in the string "qwertyqw". If I meet "qwe", then I need to replace it with "1", and if "ty", then replace it with 2. And in the end it should turn out: "1r2qw".
Answer the question
In order to leave comments, you need to log in
Overheard from a friend: "If you have a problem that you want to solve with regular expressions, you already have two problems."
Try like this:"qwertyqw".replace("qwe", "1").replace("ty", "2");
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question