Using List. To remove all null occurrences from the list, we can continuously call remove(null) until all null values are removed. Please note that the list will remain unchanged if it does not contain any null value.
In the Tree Section of the Logic Tab you will find a pair of cherries. This is the Clean Tree Component and will remove any NULL Values. If you still have NULL values further down the path then you might need to set the remove branches boolean to TRUE.
The isEmpty() method of ArrayList in java is used to check if a list is empty or not. It returns true if the list contains no elements otherwise it returns false if the list contains any element.
You'll probably want the following.
List<EmailParameterClass> parameterList = new List<EmailParameterClass>{param1, param2, param3...};
parameterList.RemoveAll(item => item == null);
I do not know of any in-built method, but you could just use linq:
parameterList = parameterList.Where(x => x != null).ToList();
The RemoveAll method should do the trick:
parameterList.RemoveAll(delegate (object o) { return o == null; });
The method OfType()
will skip the null values:
List<EmailParameterClass> parameterList =
new List<EmailParameterClass>{param1, param2, param3...};
IList<EmailParameterClass> parameterList_notnull =
parameterList.OfType<EmailParameterClass>();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With