toList method
Creates a List<String>
from the Pointer<HSTRING>
.
length
must be equal to the number of elements stored inside the
Pointer<HSTRING>
.
...
final list = pHString.toList(length: 5);
{@category winrt}
Implementation
List<String> toList({int length = 1}) {
final list = <String>[];
for (var i = 0; i < length; i++) {
final element = this[i];
if (element != 0) {
list.add(convertFromHString(this[i]));
WindowsDeleteString(this[i]);
}
}
return list;
}