I am trying to create a list from another list, such as:
List<String> namesOfLotion = List.of("Alexander Almond & Honey Moisturiser", "Max honey and almond moisturiser", "Mikhail Almond and Talc", "Mikhail Natural Almond Moisturizer", "Tigran Aloe Isolani", "Vassily Aloe Attack", "Vassily New aloe Attack");
From there I want to get all the names, which contains 'Aloe'
for which I am using following logic:
List<String> aloeLotion = trendyList.stream().anyMatch(str -> str.trim().equals("Aloe"));
But it returns me Boolean values rather than names. How Can I achieve that.
I want to carried out name of elements which contains 'Aloe', such as :
List.of("Tigran Aloe Isolani", "Vassily Aloe Attack", "Vassily New aloe Attack");
But I need to know, if it has with both ['aloe', 'Aloe'], what will be the case?