I want to essentially replace part of substring that contains the "abc"
with the *
s. I want to do this using java8 (repeat()
does not exist in java8).
String s = "abcdefgh";
String word1 = "abc";
s = s.replaceAll(word1,"*"*word1.length());
output should be:
s = "***defgh"