fromString static method
Splits specified string into elements using a separator and assigns the elements to a newly created AnyValueArray.
values
a string value to be split and assigned to AnyValueArrayseparator
a separator to split the stringremoveDuplicates
(optional) true to remove duplicated elements Returns a newly created AnyValueArray.
Implementation
static AnyValueArray fromString(String? values, String separator,
[bool removeDuplicates = false]) {
var result = AnyValueArray();
if (values == null || values.isEmpty) return result;
var items = values.split(separator);
for (var index = 0; index < items.length; index++) {
var item = items[index];
if ((item.isNotEmpty) || removeDuplicates == false) {
result._values.add(AnyValue(item));
}
}
return result;
}