import java.util.List;
      
      // Filter string that have a non-null length
      List<String> newList = initialList.stream().filter(p -> s.length > 0).collect(Collectors.toList());

      Java language logo
      Filter non-null strings

      filter
      stream
      Java Public Recipes

      Filter strings that are non-null from a list

      0 Comments

        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.