Replace a part of string in big array with replace method and Java 8

Viewed 1239

I have array String[] values = new String[100], and I need to check all strings from 10 to 35 with Java 8. Cause I don't want to do it with if and else.

For example:

for (int i = 10; i <= 35; i++){
    if (values[i].contains("something")) {
      values[i].replace("something", "something else");
    }
}

How can I do it with Java 8 and and small amount of code?

Help me please.

2 Answers
Related